Fix ktlint issues

This commit is contained in:
Benoit Marty 2024-01-10 19:33:39 +01:00
parent 140a11cf77
commit a831f05f6e
100 changed files with 66 additions and 158 deletions

View file

@ -30,7 +30,6 @@ import io.element.android.features.call.ui.ElementCallActivity
import io.element.android.libraries.designsystem.utils.CommonDrawables
class CallForegroundService : Service() {
companion object {
fun start(context: Context) {
val intent = Intent(context, CallForegroundService::class.java)

View file

@ -28,7 +28,6 @@ data class WidgetMessage(
@SerialName("action") val action: Action,
@SerialName("data") val data: JsonElement? = null,
) {
@Serializable
enum class Direction {
@SerialName("fromWidget")

View file

@ -63,7 +63,6 @@ class CallScreenPresenter @AssistedInject constructor(
private val matrixClientsProvider: MatrixClientProvider,
private val appCoroutineScope: CoroutineScope,
) : Presenter<CallScreenState> {
@AssistedFactory
interface Factory {
fun create(callType: CallType, navigator: CallScreenNavigator): CallScreenPresenter

View file

@ -20,7 +20,6 @@ import android.net.Uri
import javax.inject.Inject
class CallIntentDataParser @Inject constructor() {
private val validHttpSchemes = sequenceOf("https")
fun parse(data: String?): String? {

View file

@ -28,7 +28,6 @@ import kotlinx.coroutines.flow.MutableSharedFlow
class WebViewWidgetMessageInterceptor(
private val webView: WebView,
) : WidgetMessageInterceptor {
companion object {
// We call both the WebMessageListener and the JavascriptInterface objects in JS with this
// 'listenerName' so they can both receive the data from the WebView when

View file

@ -20,7 +20,6 @@ import io.element.android.features.call.data.WidgetMessage
import kotlinx.serialization.json.Json
object WidgetMessageSerializer {
private val coder = Json { ignoreUnknownKeys = true }
fun deserialize(message: String): Result<WidgetMessage> {

View file

@ -23,7 +23,6 @@ import io.element.android.features.call.ui.mapWebkitPermissions
import org.junit.Test
class MapWebkitPermissionsTest {
@Test
fun `given Webkit's RESOURCE_AUDIO_CAPTURE returns Android's RECORD_AUDIO permission`() {
val permission = mapWebkitPermissions(arrayOf(PermissionRequest.RESOURCE_AUDIO_CAPTURE))

View file

@ -48,7 +48,6 @@ import org.junit.Rule
import org.junit.Test
class CallScreenPresenterTest {
@get:Rule
val warmUpRule = WarmUpRule()

View file

@ -24,7 +24,6 @@ import java.net.URLEncoder
@RunWith(RobolectricTestRunner::class)
class CallIntentDataParserTest {
private val callIntentDataParser = CallIntentDataParser()
@Test

View file

@ -32,7 +32,6 @@ import kotlinx.coroutines.test.runTest
import org.junit.Test
class DefaultCallWidgetProviderTest {
@Test
fun `getWidget - fails if the session does not exist`() = runTest {
val provider = createProvider(matrixClientProvider = FakeMatrixClientProvider { Result.failure(Exception("Session not found")) })

View file

@ -25,7 +25,6 @@ class FakeCallWidgetProvider(
private val widgetDriver: FakeWidgetDriver = FakeWidgetDriver(),
private val url: String = "https://call.element.io",
) : CallWidgetProvider {
var getWidgetCalled = false
private set

View file

@ -152,7 +152,7 @@ private fun ReadReceiptsAvatars(
contentAlignment = Alignment.CenterEnd,
) {
receipts
.take(TimelineConfig.maxReadReceiptToDisplay)
.take(TimelineConfig.MAX_READ_RECEIPT_TO_DISPLAY)
.reversed()
.forEachIndexed { index, readReceiptData ->
Box(
@ -170,9 +170,9 @@ private fun ReadReceiptsAvatars(
}
}
}
if (receipts.size > TimelineConfig.maxReadReceiptToDisplay) {
if (receipts.size > TimelineConfig.MAX_READ_RECEIPT_TO_DISPLAY) {
Text(
text = "+" + (receipts.size - TimelineConfig.maxReadReceiptToDisplay),
text = "+" + (receipts.size - TimelineConfig.MAX_READ_RECEIPT_TO_DISPLAY),
style = ElementTheme.typography.fontBodyXsRegular,
color = ElementTheme.colors.textSecondary,
)

View file

@ -229,7 +229,7 @@ private fun DefaultRoomListTopBar(
contentDescription = stringResource(CommonStrings.action_search),
)
}
if (RoomListConfig.hasDropdownMenu) {
if (RoomListConfig.HAS_DROP_DOWN_MENU) {
var showMenu by remember { mutableStateOf(false) }
IconButton(
onClick = { showMenu = !showMenu }
@ -243,7 +243,7 @@ private fun DefaultRoomListTopBar(
expanded = showMenu,
onDismissRequest = { showMenu = false }
) {
if (RoomListConfig.showInviteMenuItem) {
if (RoomListConfig.SHOW_INVITE_MENU_ITEM) {
DropdownMenuItem(
onClick = {
showMenu = false
@ -259,7 +259,7 @@ private fun DefaultRoomListTopBar(
}
)
}
if (RoomListConfig.showReportProblemMenuItem) {
if (RoomListConfig.SHOW_REPORT_PROBLEM_MENU_ITEM) {
DropdownMenuItem(
onClick = {
showMenu = false

View file

@ -69,7 +69,7 @@ class SecureBackupRootNode @AssistedInject constructor(
}
private fun onLearnMoreClicked(uriHandler: UriHandler) {
uriHandler.openUri(SecureBackupConfig.LearnMoreUrl)
uriHandler.openUri(SecureBackupConfig.LEARN_MORE_URL)
}
@Composable