Skip to content
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

Merged
merged 14 commits into from Oct 20, 2022

Conversation

Florian14
Copy link
Contributor

@Florian14 Florian14 commented Oct 20, 2022

Type of change

  • WIP Feature
  • Bugfix
  • Technical
  • Other :

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

  • Physical
  • Emulator
  • OS version(s):

Checklist

Copy link
Member

@bmarty bmarty left a 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)
Copy link
Member

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.

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) }
Copy link
Member

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>()
Copy link
Member

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>()
Copy link
Member

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)
}
})
Copy link
Member

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.

Copy link
Contributor Author

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).

@Florian14 Florian14 force-pushed the feature/fre/voice_broadcast_timeline_tiles branch from ec2041b to 5cf52ad Compare October 20, 2022 20:39
@Florian14 Florian14 force-pushed the feature/fre/voice_broadcast_live_listening branch from 1004496 to 0a9f2bf Compare October 20, 2022 21:03
@@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please undo this change

@Florian14 Florian14 force-pushed the feature/fre/voice_broadcast_timeline_tiles branch from f21f753 to 34cafa3 Compare October 20, 2022 21:43
Copy link
Member

@giomfo giomfo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SGTM

Base automatically changed from feature/fre/voice_broadcast_live_listening to develop October 20, 2022 21:52
@ElementBot
Copy link

ElementBot commented Oct 20, 2022

Warnings
⚠️

vector/src/main/res/drawable/ic_voice_broadcast_16.xml#L7 - Very long vector path (1082 characters), which is bad for performance. Considering reducing precision, removing minor details or rasterizing vector.

⚠️

vector/src/main/res/drawable/ic_voice_broadcast_16.xml#L7 - Very long vector path (1082 characters), which is bad for performance. Considering reducing precision, removing minor details or rasterizing vector.

⚠️

vector/src/main/res/drawable/ic_voice_broadcast_16.xml#L10 - Very long vector path (1022 characters), which is bad for performance. Considering reducing precision, removing minor details or rasterizing vector.

⚠️

vector/src/main/res/drawable/ic_voice_broadcast_16.xml#L10 - Very long vector path (1022 characters), which is bad for performance. Considering reducing precision, removing minor details or rasterizing vector.

⚠️

vector/src/main/res/drawable/ic_voice_broadcast_16.xml#L13 - Very long vector path (997 characters), which is bad for performance. Considering reducing precision, removing minor details or rasterizing vector.

⚠️

vector/src/main/res/drawable/ic_voice_broadcast_16.xml#L13 - Very long vector path (997 characters), which is bad for performance. Considering reducing precision, removing minor details or rasterizing vector.

⚠️

vector/src/main/res/drawable/ic_voice_broadcast_16.xml#L16 - Very long vector path (928 characters), which is bad for performance. Considering reducing precision, removing minor details or rasterizing vector.

⚠️

vector/src/main/res/drawable/ic_voice_broadcast_16.xml#L16 - Very long vector path (928 characters), which is bad for performance. Considering reducing precision, removing minor details or rasterizing vector.

⚠️

vector/src/main/res/layout/item_timeline_event_view_stubs_container.xml#L2 - This <FrameLayout> can be replaced with a <merge> tag

⚠️

vector/src/main/res/layout/item_timeline_event_view_stubs_container.xml#L2 - This <FrameLayout> can be replaced with a <merge> tag

⚠️

vector/src/main/res/layout/item_timeline_event_voice_broadcast_listening_stub.xml#L59 - This tag and its children can be replaced by one <TextView/> and a compound drawable

⚠️

vector/src/main/res/layout/item_timeline_event_voice_broadcast_listening_stub.xml#L59 - This tag and its children can be replaced by one <TextView/> and a compound drawable

⚠️

vector/src/main/res/layout/item_timeline_event_voice_broadcast_listening_stub.xml#L86 - This tag and its children can be replaced by one <TextView/> and a compound drawable

⚠️

vector/src/main/res/layout/item_timeline_event_voice_broadcast_listening_stub.xml#L86 - This tag and its children can be replaced by one <TextView/> and a compound drawable

Generated by 🚫 dangerJS against 926f4d9

@sonarcloud
Copy link

sonarcloud bot commented Oct 20, 2022

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 2 Code Smells

1.5% 1.5% Coverage
0.0% 0.0% Duplication

@Florian14 Florian14 merged commit 2a977f3 into develop Oct 20, 2022
@Florian14 Florian14 deleted the feature/fre/voice_broadcast_timeline_tiles branch October 20, 2022 22:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants