-
Notifications
You must be signed in to change notification settings - Fork 170
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
Integrate Element Call with widget API #1581
Conversation
📱 Scan the QR code below to install the build (arm64 only) for this PR. |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## develop #1581 +/- ##
===========================================
- Coverage 58.92% 58.88% -0.05%
===========================================
Files 1202 1219 +17
Lines 30989 31414 +425
Branches 6345 6443 +98
===========================================
+ Hits 18261 18498 +237
- Misses 9981 10113 +132
- Partials 2747 2803 +56
☔ View full report in Codecov by Sentry. |
e361242
to
0731578
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.
Great work, thanks!
I have made some (minor) remarks.
Also I have tested what could be tested on my emu, and this is working as written in the description.
@@ -63,7 +63,7 @@ import kotlinx.parcelize.Parcelize | |||
import timber.log.Timber | |||
|
|||
@ContributesNode(AppScope::class) | |||
class RootFlowNode @AssistedInject constructor( | |||
class RootFlowNode @AssistedInject constructor( |
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 formatting issue.
appconfig/build.gradle.kts
Outdated
*/ | ||
plugins { | ||
id("java-library") | ||
id("com.android.lint") |
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 do not need lint
here I think
appconfig/build.gradle.kts
Outdated
dependencies { | ||
testImplementation(libs.test.junit) | ||
testImplementation(libs.test.truth) | ||
} |
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.
Maybe remove the dependencies
block, this is not used
private val clock: SystemClock, | ||
private val dispatchers: CoroutineDispatchers, | ||
@Assisted private val callType: CallType, | ||
@Assisted private val navigator: CallScreenNavigator, |
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.
Neat: in the project, we use to put the @Assisted
parameters first. Maybe a new Konsist
test could check that.
|
||
@AssistedFactory | ||
interface Factory { | ||
fun create(inputs: CallType, navigator: CallScreenNavigator): CallScreenPresenter |
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.
fun create(inputs: CallType, navigator: CallScreenNavigator): CallScreenPresenter | |
fun create(callType: CallType, navigator: CallScreenNavigator): CallScreenPresenter |
?
|
||
fun givenInterceptedMessage(message: String) { | ||
interceptedMessages.tryEmit(message) | ||
} |
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.
Maybe extract all those Fake classes to their own file?
|
||
import com.google.common.truth.Truth.assertThat | ||
import com.google.common.truth.Truth |
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 prefer the previous import, the code looks cleaner. But happy with this until we decide and add a Konsist test for this :)
@@ -32,7 +31,7 @@ open class AccountProviderProvider : PreviewParameterProvider<AccountProvider> { | |||
} | |||
|
|||
fun anAccountProvider() = AccountProvider( | |||
url = LoginConstants.MATRIX_ORG_URL, | |||
url = io.element.android.appconfig.AuthenticationConfig.MATRIX_ORG_URL, |
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.
Maybe add an import? (probably due to refacto)
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.
Yes, the refactor broke the imports somehow.
@@ -196,7 +195,7 @@ fun SearchAccountProviderView( | |||
|
|||
@Composable | |||
private fun HomeserverData.toAccountProvider(): AccountProvider { | |||
val isMatrixOrg = homeserverUrl == LoginConstants.MATRIX_ORG_URL | |||
val isMatrixOrg = homeserverUrl == io.element.android.appconfig.AuthenticationConfig.MATRIX_ORG_URL |
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.
import?
actions = { | ||
if (inRoomCallsEnabled) { | ||
IconButton(onClick = onJoinCallClicked) { | ||
Icon(CommonDrawables.ic_compound_video_call, contentDescription = "Join call") |
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.
i18n for the content description? This is maybe a temporary string, since the button is also used to create a call.
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've removed it until we can get the call state and decide whether we should display join/create call here.
aeb91e7
to
1d6f935
Compare
1d6f935
to
874c137
Compare
|
- Add `appconfig` module and extract constants that can be overridden in forks there. - Add an Element Call feature flag, disabled by default. - Refactor the whole `ElementCallActivity`, move most logic out of it. - Integrate with the Rust Widget Driver API (note the Rust SDK version used in this PR lacks some needed changes to make the calls actually work). - Handle calls differently based on `CallType`. - Add UI to create/join a call.
f77ba1d
to
4ab5611
Compare
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Type of change
Content
Lots of changes, sorry for the huge PR:
ElementCallActivity
toCallScreenPresenter
.CallType
to separate EC SPA calls from internal room calls.CallScreenPresenter
forCallScreenView
.RustWidgetDriver
andWebViewWidgetMessageInterceptor
, which relay messages from Rust to the widget in the WebView and viceversa.appconfig
module to store config values the clients might need to customize (including the EC default base url).Motivation and context
We needed to integrate the EC Widget soon, since the branch was starting to drift apart from
develop
. With this, the base API and integration of the widget API should be done, although we still need the final Rust code to be merged and included for the calls to work properly (note that this was tested with another branch with a PoC of that code and calls worked fine besides some bugs).Screenshots / GIFs
These are included in the changed files.
Tests
Tested devices
Checklist