Fix some errors
This commit is contained in:
parent
3eeeee2c98
commit
b4723bb182
9 changed files with 16 additions and 98 deletions
|
|
@ -38,9 +38,9 @@ import io.element.android.features.login.impl.R
|
||||||
import io.element.android.libraries.designsystem.ElementTextStyles
|
import io.element.android.libraries.designsystem.ElementTextStyles
|
||||||
import io.element.android.libraries.designsystem.atomic.atoms.RoundedIconAtom
|
import io.element.android.libraries.designsystem.atomic.atoms.RoundedIconAtom
|
||||||
import io.element.android.libraries.designsystem.atomic.atoms.RoundedIconAtomSize
|
import io.element.android.libraries.designsystem.atomic.atoms.RoundedIconAtomSize
|
||||||
import io.element.android.libraries.designsystem.atomic.atoms.SeparatorAtom
|
|
||||||
import io.element.android.libraries.designsystem.preview.ElementPreviewDark
|
import io.element.android.libraries.designsystem.preview.ElementPreviewDark
|
||||||
import io.element.android.libraries.designsystem.preview.ElementPreviewLight
|
import io.element.android.libraries.designsystem.preview.ElementPreviewLight
|
||||||
|
import io.element.android.libraries.designsystem.theme.components.Divider
|
||||||
import io.element.android.libraries.designsystem.theme.components.Icon
|
import io.element.android.libraries.designsystem.theme.components.Icon
|
||||||
import io.element.android.libraries.designsystem.theme.components.Text
|
import io.element.android.libraries.designsystem.theme.components.Text
|
||||||
|
|
||||||
|
|
@ -56,7 +56,7 @@ fun AccountProviderView(
|
||||||
Column(modifier = modifier
|
Column(modifier = modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
.clickable { onClick() }) {
|
.clickable { onClick() }) {
|
||||||
SeparatorAtom()
|
Divider()
|
||||||
Column(
|
Column(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxWidth()
|
.fillMaxWidth()
|
||||||
|
|
@ -82,7 +82,7 @@ fun AccountProviderView(
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
Text(
|
Text(
|
||||||
modifier = modifier
|
modifier = Modifier
|
||||||
.padding(start = 16.dp)
|
.padding(start = 16.dp)
|
||||||
.weight(1f),
|
.weight(1f),
|
||||||
text = item.title,
|
text = item.title,
|
||||||
|
|
@ -102,7 +102,7 @@ fun AccountProviderView(
|
||||||
}
|
}
|
||||||
if (item.subtitle != null) {
|
if (item.subtitle != null) {
|
||||||
Text(
|
Text(
|
||||||
modifier = modifier
|
modifier = Modifier
|
||||||
.padding(start = 46.dp, bottom = 12.dp, end = 26.dp),
|
.padding(start = 46.dp, bottom = 12.dp, end = 26.dp),
|
||||||
text = item.subtitle,
|
text = item.subtitle,
|
||||||
style = ElementTextStyles.Regular.subheadline.copy(textAlign = TextAlign.Start),
|
style = ElementTextStyles.Regular.subheadline.copy(textAlign = TextAlign.Start),
|
||||||
|
|
|
||||||
|
|
@ -1,20 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2023 New Vector Ltd
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package io.element.android.features.login.impl.changeaccountprovider
|
|
||||||
|
|
||||||
sealed interface ChangeAccountProviderEvents {
|
|
||||||
}
|
|
||||||
|
|
@ -14,7 +14,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@file:OptIn(ExperimentalMaterial3Api::class, ExperimentalLayoutApi::class, ExperimentalMaterial3Api::class)
|
@file:OptIn(ExperimentalMaterial3Api::class, ExperimentalLayoutApi::class)
|
||||||
|
|
||||||
package io.element.android.features.login.impl.changeaccountprovider.form
|
package io.element.android.features.login.impl.changeaccountprovider.form
|
||||||
|
|
||||||
|
|
@ -71,7 +71,7 @@ import io.element.android.libraries.designsystem.theme.components.Text
|
||||||
fun ChangeAccountProviderFormView(
|
fun ChangeAccountProviderFormView(
|
||||||
state: ChangeAccountProviderFormState,
|
state: ChangeAccountProviderFormState,
|
||||||
modifier: Modifier = Modifier,
|
modifier: Modifier = Modifier,
|
||||||
onBackPressed: () -> Unit,
|
onBackPressed: () -> Unit = {},
|
||||||
onAccountProviderClicked: (AccountProvider) -> Unit = {},
|
onAccountProviderClicked: (AccountProvider) -> Unit = {},
|
||||||
) {
|
) {
|
||||||
val eventSink = state.eventSink
|
val eventSink = state.eventSink
|
||||||
|
|
@ -197,6 +197,5 @@ fun ChangeAccountProviderFormViewDarkPreview(@PreviewParameter(ChangeAccountProv
|
||||||
private fun ContentToPreview(state: ChangeAccountProviderFormState) {
|
private fun ContentToPreview(state: ChangeAccountProviderFormState) {
|
||||||
ChangeAccountProviderFormView(
|
ChangeAccountProviderFormView(
|
||||||
state = state,
|
state = state,
|
||||||
onBackPressed = { }
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2020 The Matrix.org Foundation C.I.C.
|
* Copyright (c) 2023 New Vector Ltd
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2020 The Matrix.org Foundation C.I.C.
|
* Copyright (c) 2023 New Vector Ltd
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package io.element.android.features.login.impl.changeaccountprovider.form.network
|
package io.element.android.features.login.impl.changeaccountprovider.form.network
|
||||||
|
|
||||||
import retrofit2.http.GET
|
import retrofit2.http.GET
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ class WellknownRequest @Inject constructor(
|
||||||
private val retrofitFactory: RetrofitFactory,
|
private val retrofitFactory: RetrofitFactory,
|
||||||
) {
|
) {
|
||||||
/**
|
/**
|
||||||
* Return true if the wellknown can be retrieved and is valid
|
* Return true if the wellknown can be retrieved and is valid.
|
||||||
* @param baseUrl for instance https://matrix.org
|
* @param baseUrl for instance https://matrix.org
|
||||||
*/
|
*/
|
||||||
suspend fun execute(baseUrl: String): Boolean {
|
suspend fun execute(baseUrl: String): Boolean {
|
||||||
|
|
|
||||||
|
|
@ -139,13 +139,13 @@ fun LoginPasswordView(
|
||||||
submit = ::submit
|
submit = ::submit
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (state.loginAction is Async.Failure) {
|
if (state.loginAction is Async.Failure) {
|
||||||
LoginErrorDialog(error = state.loginAction.error, onDismiss = {
|
LoginErrorDialog(error = state.loginAction.error, onDismiss = {
|
||||||
state.eventSink(LoginPasswordEvents.ClearError)
|
state.eventSink(LoginPasswordEvents.ClearError)
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,62 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2023 New Vector Ltd
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package io.element.android.libraries.designsystem.atomic.atoms
|
|
||||||
|
|
||||||
import androidx.compose.foundation.background
|
|
||||||
import androidx.compose.foundation.layout.Spacer
|
|
||||||
import androidx.compose.foundation.layout.fillMaxWidth
|
|
||||||
import androidx.compose.foundation.layout.height
|
|
||||||
import androidx.compose.foundation.layout.padding
|
|
||||||
import androidx.compose.runtime.Composable
|
|
||||||
import androidx.compose.ui.Modifier
|
|
||||||
import androidx.compose.ui.tooling.preview.Preview
|
|
||||||
import androidx.compose.ui.unit.Dp
|
|
||||||
import androidx.compose.ui.unit.dp
|
|
||||||
import io.element.android.libraries.designsystem.preview.ElementPreviewDark
|
|
||||||
import io.element.android.libraries.designsystem.preview.ElementPreviewLight
|
|
||||||
import io.element.android.libraries.designsystem.theme.LocalColors
|
|
||||||
|
|
||||||
@Composable
|
|
||||||
fun SeparatorAtom(
|
|
||||||
modifier: Modifier = Modifier,
|
|
||||||
horizontalPadding: Dp = 0.dp,
|
|
||||||
) {
|
|
||||||
Spacer(
|
|
||||||
modifier = modifier
|
|
||||||
.height(0.5f.dp)
|
|
||||||
.fillMaxWidth()
|
|
||||||
.padding(horizontal = horizontalPadding)
|
|
||||||
.background(
|
|
||||||
color = LocalColors.current.quinary,
|
|
||||||
)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
@Preview
|
|
||||||
@Composable
|
|
||||||
internal fun SeparatorAtomLightPreview() =
|
|
||||||
ElementPreviewLight { ContentToPreview() }
|
|
||||||
|
|
||||||
@Preview
|
|
||||||
@Composable
|
|
||||||
internal fun SeparatorAtomDarkPreview() =
|
|
||||||
ElementPreviewDark { ContentToPreview() }
|
|
||||||
|
|
||||||
@Composable
|
|
||||||
private fun ContentToPreview() {
|
|
||||||
SeparatorAtom(horizontalPadding = 20.dp)
|
|
||||||
}
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue