-
Notifications
You must be signed in to change notification settings - Fork 754
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
Voice Broadcast - Improve recording and listening tiles in the timeline #7421
Voice Broadcast - Improve recording and listening tiles in the timeline #7421
Conversation
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 remarks, else LGTM.
.drawableProvider(drawableProvider) | ||
.voiceBroadcastRecorder(voiceBroadcastRecorder) | ||
.leftGuideline(avatarSizeProvider.leftGuideline) | ||
.callback(callback) |
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.
You need to call .id(...)
. There are lots of ...Item_()
without id in the project though, this is strange.
...n/java/im/vector/app/features/home/room/detail/timeline/factory/VoiceBroadcastItemFactory.kt
Show resolved
Hide resolved
recordButton.setImageDrawable(drawable) | ||
recordButton.contentDescription = holder.view.resources.getString(R.string.a11y_pause_voice_broadcast_record) | ||
recordButton.setOnClickListener { attributes.callback?.onTimelineItemAction(VoiceBroadcastAction.Recording.Pause) } | ||
stopRecordButton.setOnClickListener { attributes.callback?.onTimelineItemAction(VoiceBroadcastAction.Recording.Stop) } |
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.
You can use onClick {
which include a debouncer. Applicable to all setOnClickListener
in the Item
} | ||
private var currentRoomId: String? = null | ||
private var listeners = mutableListOf<Listener>() |
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.
Better to use a CopyOnWriteArrayList
|
||
override var listener: VoiceBroadcastRecorder.Listener? = null | ||
private val listeners = mutableListOf<VoiceBroadcastRecorder.Listener>() |
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.
Better to use a CopyOnWriteArrayList
override fun onVoiceMessageCreated(file: File, sequence: Int) { | ||
sendVoiceFile(room, file, eventId, sequence) | ||
} | ||
}) |
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.
You need to remove the listener somewhere.
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 did not remove it from here because it will be removed when the record will be stopped from StopVoiceBroadcastUseCase (stopping a record cause the cleaning of the listeners).
ec2041b
to
5cf52ad
Compare
1004496
to
0a9f2bf
Compare
@@ -27,5 +27,5 @@ object VoiceBroadcastConstants { | |||
const val VOICE_BROADCAST_CHUNK_KEY = "io.element.voice_broadcast_chunk" | |||
|
|||
/** Default voice broadcast chunk duration, in seconds. */ | |||
const val DEFAULT_CHUNK_LENGTH_IN_SECONDS = 120 | |||
const val DEFAULT_CHUNK_LENGTH_IN_SECONDS = 10 |
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.
Please undo this change
f21f753
to
34cafa3
Compare
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.
SGTM
|
SonarCloud Quality Gate failed. |
Type of change
Content
Display dedicated tiles in the timeline to distinguish a recording VB from a listening one inspired according to the provided design
Motivation and context
Continue #7127
Screenshots / GIFs
Tests
Play with the voice broadcast and verify that the UI is updated as expected from the recorder and the listener perspective (live, paused, etc...)
Tested devices
Checklist