-
Notifications
You must be signed in to change notification settings - Fork 739
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
Poll Feature - Create #4360
Poll Feature - Create #4360
Conversation
* develop: (129 commits) Improve Rx sequence regarding listener adding changelog entry using correct license for matrix-sdk test extending the room name resolved to create a dedicated room name data class which contains a normalized version of the room name Remove shortcut as soon as a PIN code is set ensuring the store migration class is always equal to other store migration instances - is needed as realm will throw if multiple migration instances are created and they don't match removing extra query definition by chaining the query creation with modifiers removing noisy log which duplicates a type clause and fixing when casing formatting to have a case per line documenting the different query cases making the isNormalized function an extension and internal to the sdk Cache immutable value Do not show shortcuts if a PIN code is set Remove (disable) shortcut if a room is left Ensure ShortcutsHandler get all the joined rooms #4168 Add `sortOrder: RoomSortOrder` parameter, with no API break Clean code adding normalised room display name field and making use of it when filtering rooms by name - fixes non latin-1 character set room names from being ignored when searching with inexact casing adding normalisation to the query string cases making value processing an injectable class, it will need to have its own dependencies to support normalisation porting QueryStringValue to sealed interface with a sub category for the content based values - allows for handling those cases separately for normalisation ... # Conflicts: # vector/src/main/java/im/vector/app/core/di/ScreenComponent.kt
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.
Nice work, thanks.
Some remarks plus:
- How to the attachment picker is displayed if the keyboard is opened?
- Maybe temporarily hide the option to create poll in this PR so that we can merge it once it's approved
vector/src/main/java/im/vector/app/features/createpoll/CreatePollViewModel.kt
Outdated
Show resolved
Hide resolved
vector/src/main/java/im/vector/app/features/createpoll/CreatePollAction.kt
Outdated
Show resolved
Hide resolved
vector/src/main/java/im/vector/app/features/createpoll/CreatePollActivity.kt
Outdated
Show resolved
Hide resolved
vector/src/main/java/im/vector/app/features/createpoll/CreatePollViewModel.kt
Outdated
Show resolved
Hide resolved
Also please have a look at the CI |
Is there an existing issue? If yes it should be linked to this PR |
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.
Some remarks
vector/src/main/java/im/vector/app/features/createpoll/CreatePollActivity.kt
Outdated
Show resolved
Hide resolved
vector/src/main/java/im/vector/app/features/createpoll/CreatePollFragment.kt
Outdated
Show resolved
Hide resolved
|
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.
Thanks for the update.
A few more comments for you. Also can you please check the CI status?
val intent = CreatePollActivity.getIntent(context, CreatePollArgs(roomId = roomId)) | ||
val intent = CreatePollActivity.getIntent( | ||
context, | ||
CreatePollArgs(roomId = roomId, minOptionsCount = CreatePollViewModel.MIN_OPTIONS_COUNT) |
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.
What is the point to pass minOptionsCount
as an Activity parameter?
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 thought it was necessary to use it in CreatePollViewState
. Fixed by using const value in ViewModel directly.
canCreatePoll = canCreatePoll(question, options), | ||
canAddMoreOptions = options.size < MAX_OPTIONS_COUNT | ||
) | ||
} |
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.
👍
) : MavericksState { | ||
|
||
constructor(args: CreatePollArgs) : this( | ||
roomId = args.roomId | ||
roomId = args.roomId, | ||
options = List(args.minOptionsCount) { "" } |
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.
This is not the best place to init options
. I would have done it on line 24 instead
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.
Done.
@onurays I'm not able to see the polls feature in the test build you sent |
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.
-
We need to left align the close button with the content below please ( cross aligned with title under)
-
Change the colour of the text field frames so it matches Figma colours --> Quinary
-
The option text fields should not grow (this behaviour should only happen for the poll question)
-
The delete Option button should be centre aligned with the text field
-
The Create Poll button disabled state visual does not match Figma's disabled state. For more info on buttons and core components please check Compound UI kit.
-
Weird animation when no options fields are displayed and you press on Add option. The add option text animates downwards. Could you remove this?
-
On user input in the text field: the Return key Dismiss the keyboard and the field should return to unfocussed state.
-
Enlarge the default height of the question to double size. The field should only grow if the character limit is reached. The return button should dismiss the keyboard and the field should be unfocussed. See Figma here https://www.figma.com/file/tepA3ELWBE5v4O2WB8PqWn/Polls?node-id=496%3A52205
-
The Create poll CTA should not move above the composer. It should remain under the Add option button at all times
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.
Thanks for the edits @onurays!
how does the screen look in dark mode? |
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.
small remark about double checking dark mode, otherwise looks good!
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.
Just a few more questions / remark.
Also please fix errors reported by the CI
|
||
holder.textInputEditText.isEnabled = enabled | ||
if (singleLine) { | ||
holder.textInputEditText.setSingleLine() |
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.
When doing binding, we have to take care of the recycling of views. So a else block is needed here I think
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.
Done.
} | ||
imeOptions?.let { | ||
holder.textInputEditText.imeOptions = it | ||
} |
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.
same remark here
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.
Done.
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
views.toolbar.visibility = View.GONE |
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.
Strange to hide the toolbar here. I guess the toolbar is part of the fragment?
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.
Otherwise, it shows the back button on Toolbar. We are doing the same for CreateDirectRoomActivity
and InviteUsersToRoomActivity
.
} | ||
|
||
private val hideToastRunnable = Runnable { | ||
views.createPollToast.isVisible = false |
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 think this can crash if the Fragment has been destroyed
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.
We are using the same mechanism while recording voice messages. It is not crashing because it uses Handler inside. Also, we will never show toast on this screen, since we disable the button.
But I want to keep this to protect against post improvements.
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.
The CI is not happy, can you have a look please?
<string name="create_poll_title">Create Poll</string> | ||
<string name="create_poll_question_title">Poll question or topic</string> | ||
<string name="create_poll_question_hint">Question or topic</string> | ||
<string name="create_poll_options_title">Create options</string> |
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.
We discussed about that wording in a Matrix room. Maybe "Options" is better here. What is the status?
CC @gaelledel
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.
@gaelledel wants to use "Create options".
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.
OK, thanks
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.
Thanks for the update.
I will do a quick change on the style, sth I did not see before, but not blocking.
Figma