feat(join by alias) : format code
This commit is contained in:
@@ -28,7 +28,6 @@ class DefaultCreateRoomNavigator(
|
||||
private val overlay: Overlay<NavTarget>,
|
||||
private val openRoom: (RoomIdOrAlias, List<String>) -> Unit,
|
||||
) : CreateRoomNavigator {
|
||||
|
||||
override fun onOpenRoom(roomIdOrAlias: RoomIdOrAlias, serverNames: List<String>) = openRoom(roomIdOrAlias, serverNames)
|
||||
|
||||
override fun onCreateNewRoom() {
|
||||
|
||||
@@ -60,7 +60,6 @@ class ConfigureRoomFlowNode @AssistedInject constructor(
|
||||
data object ConfigureRoom : NavTarget
|
||||
}
|
||||
|
||||
|
||||
override fun resolve(navTarget: NavTarget, buildContext: BuildContext): Node {
|
||||
return when (navTarget) {
|
||||
NavTarget.Root -> {
|
||||
|
||||
@@ -30,8 +30,6 @@ import io.element.android.libraries.architecture.BaseFlowNode
|
||||
import io.element.android.libraries.architecture.OverlayView
|
||||
import io.element.android.libraries.architecture.createNode
|
||||
import io.element.android.libraries.di.SessionScope
|
||||
import io.element.android.libraries.matrix.api.core.RoomId
|
||||
import io.element.android.libraries.matrix.api.core.RoomIdOrAlias
|
||||
import kotlinx.parcelize.Parcelize
|
||||
|
||||
@ContributesNode(SessionScope::class)
|
||||
|
||||
@@ -30,7 +30,6 @@ class ConfigureRoomNode @AssistedInject constructor(
|
||||
private val presenter: ConfigureRoomPresenter,
|
||||
private val analyticsService: AnalyticsService,
|
||||
) : Node(buildContext, plugins = plugins) {
|
||||
|
||||
private val navigator = plugins<CreateRoomNavigator>().first()
|
||||
|
||||
init {
|
||||
|
||||
@@ -9,6 +9,6 @@ package io.element.android.features.createroom.impl.joinbyaddress
|
||||
|
||||
sealed interface JoinRoomByAddressEvents {
|
||||
data object Dismiss : JoinRoomByAddressEvents
|
||||
data object Continue: JoinRoomByAddressEvents
|
||||
data object Continue : JoinRoomByAddressEvents
|
||||
data class UpdateAddress(val address: String) : JoinRoomByAddressEvents
|
||||
}
|
||||
|
||||
@@ -25,7 +25,6 @@ class JoinRoomByAddressNode @AssistedInject constructor(
|
||||
@Assisted plugins: List<Plugin>,
|
||||
presenterFactory: JoinRoomByAddressPresenter.Factory,
|
||||
) : Node(buildContext, plugins = plugins) {
|
||||
|
||||
private val navigator = plugins<CreateRoomNavigator>().first()
|
||||
private val presenter = presenterFactory.create(navigator)
|
||||
|
||||
|
||||
@@ -36,7 +36,6 @@ class JoinRoomByAddressPresenter @AssistedInject constructor(
|
||||
private val client: MatrixClient,
|
||||
private val roomAliasHelper: RoomAliasHelper,
|
||||
) : Presenter<JoinRoomByAddressState> {
|
||||
|
||||
@AssistedFactory
|
||||
interface Factory {
|
||||
fun create(navigator: CreateRoomNavigator): JoinRoomByAddressPresenter
|
||||
@@ -137,6 +136,3 @@ class JoinRoomByAddressPresenter @AssistedInject constructor(
|
||||
} ?: RoomAddressState.RoomNotFound
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -132,4 +132,3 @@ internal fun JoinRoomByAddressViewPreview(
|
||||
) = ElementPreview {
|
||||
JoinRoomByAddressView(state = state)
|
||||
}
|
||||
|
||||
|
||||
@@ -34,7 +34,6 @@ class CreateRoomRootNode @AssistedInject constructor(
|
||||
private val analyticsService: AnalyticsService,
|
||||
private val inviteFriendsUseCase: InviteFriendsUseCase,
|
||||
) : Node(buildContext, plugins = plugins) {
|
||||
|
||||
private val navigator = plugins<CreateRoomNavigator>().first()
|
||||
|
||||
init {
|
||||
|
||||
@@ -15,7 +15,6 @@ class FakeCreateRoomNavigator(
|
||||
private val createNewRoomLambda: () -> Unit = {},
|
||||
private val showJoinRoomByAddressLambda: () -> Unit = {},
|
||||
private val dismissJoinRoomByAddressLambda: () -> Unit = {},
|
||||
|
||||
) : CreateRoomNavigator {
|
||||
override fun onOpenRoom(roomIdOrAlias: RoomIdOrAlias, serverNames: List<String>) {
|
||||
openRoomLambda(roomIdOrAlias, serverNames)
|
||||
|
||||
@@ -22,7 +22,6 @@ import kotlinx.coroutines.test.runTest
|
||||
import org.junit.Test
|
||||
|
||||
class JoinRoomByAddressPresenterTest {
|
||||
|
||||
@Test
|
||||
fun `present - initial state`() = runTest {
|
||||
val presenter = createJoinRoomByAddressPresenter()
|
||||
|
||||
@@ -24,7 +24,6 @@ import org.junit.runner.RunWith
|
||||
|
||||
@RunWith(AndroidJUnit4::class)
|
||||
class JoinRoomByAddressViewTest {
|
||||
|
||||
@get:Rule
|
||||
val rule = createAndroidComposeRule<ComponentActivity>()
|
||||
|
||||
@@ -52,7 +51,6 @@ class JoinRoomByAddressViewTest {
|
||||
rule.clickOn(CommonStrings.action_continue)
|
||||
eventsRecorder.assertSingle(JoinRoomByAddressEvents.Continue)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private fun <R : TestRule> AndroidComposeTestRule<R, ComponentActivity>.setJoinRoomByAddressView(
|
||||
|
||||
@@ -91,7 +91,7 @@ fun BugReportView(
|
||||
keyboardController?.hide()
|
||||
}),
|
||||
minLines = 3,
|
||||
validity = if(state.isDescriptionInError) TextFieldValidity.Invalid else null,
|
||||
validity = if (state.isDescriptionInError) TextFieldValidity.Invalid else null,
|
||||
)
|
||||
}
|
||||
Spacer(modifier = Modifier.height(16.dp))
|
||||
|
||||
@@ -321,7 +321,7 @@ private fun ContentToPreview() {
|
||||
TextField(
|
||||
onValueChange = {},
|
||||
label = "Label",
|
||||
value = "Hello val=${validity}, en=${enabled.asInt()}, ro=${readonly.asInt()}",
|
||||
value = "Hello val=$validity, en=${enabled.asInt()}, ro=${readonly.asInt()}",
|
||||
supportingText = "Supporting text",
|
||||
validity = validity,
|
||||
enabled = enabled,
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
package io.element.android.libraries.matrix.ui.room.address
|
||||
|
||||
import androidx.compose.runtime.Immutable
|
||||
import io.element.android.libraries.designsystem.theme.components.TextFieldValidity
|
||||
|
||||
/**
|
||||
* Represents the validity state of a room address.
|
||||
|
||||
Reference in New Issue
Block a user