Merge pull request #53 from vector-im/feature/fga/clean_code_hierarchy

Feature/fga/clean code hierarchy
This commit is contained in:
ganfra 2023-01-23 12:26:36 +01:00 committed by GitHub
commit c1789b133e
290 changed files with 1058 additions and 1038 deletions

View file

@ -21,11 +21,11 @@ plugins {
}
android {
namespace = "io.element.android.x.libraries.architecture"
namespace = "io.element.android.libraries.architecture"
}
dependencies {
api(project(":libraries:di"))
api(projects.libraries.di)
api(libs.dagger)
api(libs.appyx.core)
api(libs.molecule.runtime)

View file

@ -14,7 +14,7 @@
* limitations under the License.
*/
package io.element.android.x.architecture
package io.element.android.libraries.architecture
import com.bumble.appyx.core.modality.BuildContext
import com.bumble.appyx.core.node.Node

View file

@ -14,7 +14,7 @@
* limitations under the License.
*/
package io.element.android.x.architecture
package io.element.android.libraries.architecture
import androidx.compose.runtime.MutableState
import androidx.compose.runtime.Stable

View file

@ -14,12 +14,12 @@
* limitations under the License.
*/
package io.element.android.x.architecture
package io.element.android.libraries.architecture
import android.content.Context
import android.content.ContextWrapper
import com.bumble.appyx.core.node.Node
import io.element.android.x.di.DaggerComponentOwner
import io.element.android.libraries.di.DaggerComponentOwner
inline fun <reified T : Any> Node.bindings() = bindings(T::class.java)
inline fun <reified T : Any> Context.bindings() = bindings(T::class.java)

View file

@ -14,7 +14,7 @@
* limitations under the License.
*/
package io.element.android.x.architecture
package io.element.android.libraries.architecture
import com.bumble.appyx.core.modality.BuildContext
import com.bumble.appyx.core.node.Node

View file

@ -14,7 +14,7 @@
* limitations under the License.
*/
package io.element.android.x.architecture
package io.element.android.libraries.architecture
import com.bumble.appyx.core.node.Node
import dagger.MapKey

View file

@ -14,7 +14,7 @@
* limitations under the License.
*/
package io.element.android.x.architecture
package io.element.android.libraries.architecture
import androidx.compose.runtime.Composable

View file

@ -14,7 +14,7 @@
* limitations under the License.
*/
package io.element.android.x.architecture
package io.element.android.libraries.architecture
import androidx.lifecycle.LifecycleOwner
import androidx.lifecycle.lifecycleScope

View file

@ -19,5 +19,5 @@ plugins {
}
android {
namespace = "io.element.android.x.core"
namespace = "io.element.android.libraries.core"
}

View file

@ -14,7 +14,7 @@
* limitations under the License.
*/
package io.element.android.x.core.bitmap
package io.element.android.libraries.core.bitmap
import android.graphics.Bitmap
import java.io.File

View file

@ -14,7 +14,7 @@
* limitations under the License.
*/
package io.element.android.x.core.bool
package io.element.android.libraries.core.bool
fun Boolean?.orTrue() = this ?: true

View file

@ -14,7 +14,7 @@
* limitations under the License.
*/
package io.element.android.x.core.compose
package io.element.android.libraries.core.compose
import androidx.compose.foundation.layout.ExperimentalLayoutApi
import androidx.compose.foundation.layout.WindowInsets

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 New Vector Ltd
* 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.
@ -14,12 +14,12 @@
* limitations under the License.
*/
package io.element.android.x.core.compose
package io.element.android.libraries.core.compose
import androidx.compose.runtime.Composable
import androidx.compose.runtime.SideEffect
import androidx.compose.runtime.remember
import io.element.android.x.core.BuildConfig
import io.element.android.libraries.core.BuildConfig
import timber.log.Timber
// Note the inline function below which ensures that this function is essentially

View file

@ -14,7 +14,7 @@
* limitations under the License.
*/
package io.element.android.x.core.compose
package io.element.android.libraries.core.compose
import androidx.compose.runtime.Composable
import androidx.compose.runtime.DisposableEffect

View file

@ -14,7 +14,7 @@
* limitations under the License.
*/
package io.element.android.x.core.compose
package io.element.android.libraries.core.compose
import androidx.compose.ui.tooling.preview.PreviewParameterProvider

View file

@ -14,7 +14,7 @@
* limitations under the License.
*/
package io.element.android.x.core.compose
package io.element.android.libraries.core.compose
import androidx.compose.runtime.Composable
import androidx.compose.runtime.MutableState

View file

@ -14,7 +14,7 @@
* limitations under the License.
*/
package io.element.android.x.core.coroutine
package io.element.android.libraries.core.coroutine
import kotlinx.coroutines.CoroutineDispatcher

View file

@ -14,7 +14,7 @@
* limitations under the License.
*/
package io.element.android.x.core.coroutine
package io.element.android.libraries.core.coroutine
import android.os.SystemClock
import kotlinx.coroutines.CoroutineScope

View file

@ -14,7 +14,7 @@
* limitations under the License.
*/
package io.element.android.x.core.coroutine
package io.element.android.libraries.core.coroutine
import kotlinx.coroutines.async
import kotlinx.coroutines.awaitAll

View file

@ -14,7 +14,7 @@
* limitations under the License.
*/
package io.element.android.x.core.data
package io.element.android.libraries.core.data
/**
* Wrapper for a CharSequence, which support mutation of the CharSequence.

View file

@ -14,7 +14,7 @@
* limitations under the License.
*/
package io.element.android.x.core.data
package io.element.android.libraries.core.data
import timber.log.Timber

View file

@ -14,7 +14,7 @@
* limitations under the License.
*/
package io.element.android.x.core.extensions
package io.element.android.libraries.core.extensions
import android.util.Patterns

View file

@ -14,7 +14,7 @@
* limitations under the License.
*/
package io.element.android.x.core.file
package io.element.android.libraries.core.file
import java.io.File
import java.util.zip.GZIPOutputStream

View file

@ -14,7 +14,7 @@
* limitations under the License.
*/
package io.element.android.x.core.hardware
package io.element.android.libraries.core.hardware
import android.content.Context
import android.os.Build

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 New Vector Ltd
* 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.
@ -14,9 +14,9 @@
* limitations under the License.
*/
package io.element.android.x.core.mimetype
package io.element.android.libraries.core.mimetype
import io.element.android.x.core.bool.orFalse
import io.element.android.libraries.core.bool.orFalse
// The Android SDK does not provide constant for mime type, add some of them here
object MimeTypes {

View file

@ -14,7 +14,7 @@
* limitations under the License.
*/
package io.element.android.x.core.screenshot
package io.element.android.libraries.core.screenshot
import android.app.Activity
import android.graphics.Bitmap

View file

@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.element.android.x.core.ui
package io.element.android.libraries.core.ui
import android.content.res.Resources
import android.util.TypedValue

View file

@ -14,7 +14,7 @@
* limitations under the License.
*/
package io.element.android.x.core.ui
package io.element.android.libraries.core.ui
import android.view.View
import android.view.inputmethod.InputMethodManager

View file

@ -14,7 +14,7 @@
* limitations under the License.
*/
package io.element.android.x.core.uri
package io.element.android.libraries.core.uri
import java.net.URL

View file

@ -22,14 +22,14 @@ plugins {
}
android {
namespace = "io.element.android.x.libraries.designsystem"
namespace = "io.element.android.libraries.designsystem"
dependencies {
// Should not be there, but this is a POC
implementation(libs.coil.compose)
implementation(libs.accompanist.systemui)
implementation(project(":libraries:elementresources"))
implementation(project(":libraries:ui-strings"))
implementation(projects.libraries.elementresources)
implementation(projects.libraries.uiStrings)
ksp(libs.showkase.processor)
}
}

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 New Vector Ltd
* 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.
@ -14,7 +14,7 @@
* limitations under the License.
*/
package io.element.android.x.designsystem
package io.element.android.libraries.designsystem
import androidx.compose.ui.graphics.Color
import com.airbnb.android.showkase.annotation.ShowkaseColor

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 New Vector Ltd
* 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.
@ -14,7 +14,7 @@
* limitations under the License.
*/
package io.element.android.x.designsystem
package io.element.android.libraries.designsystem
import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 New Vector Ltd
* 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.
@ -14,7 +14,7 @@
* limitations under the License.
*/
package io.element.android.x.designsystem
package io.element.android.libraries.designsystem
import android.os.Build
import androidx.compose.foundation.isSystemInDarkTheme

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 New Vector Ltd
* 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.
@ -14,7 +14,7 @@
* limitations under the License.
*/
package io.element.android.x.designsystem
package io.element.android.libraries.designsystem
import androidx.compose.material3.Typography
import androidx.compose.ui.text.TextStyle

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 New Vector Ltd
* 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.
@ -14,9 +14,7 @@
* limitations under the License.
*/
package io.element.android.x.designsystem
import io.element.android.x.libraries.designsystem.R
package io.element.android.libraries.designsystem
object VectorIcons {
val Copy = R.drawable.ic_content_copy

View file

@ -14,7 +14,7 @@
* limitations under the License.
*/
package io.element.android.x.designsystem.components
package io.element.android.libraries.designsystem.components
import androidx.compose.foundation.gestures.detectTapGestures
import androidx.compose.foundation.interaction.MutableInteractionSource

View file

@ -14,7 +14,7 @@
* limitations under the License.
*/
package io.element.android.x.designsystem.components
package io.element.android.libraries.designsystem.components
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxWidth

View file

@ -14,7 +14,7 @@
* limitations under the License.
*/
package io.element.android.x.designsystem.components
package io.element.android.libraries.designsystem.components
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box

View file

@ -14,7 +14,7 @@
* limitations under the License.
*/
package io.element.android.x.designsystem.components
package io.element.android.libraries.designsystem.components
import androidx.compose.material3.Button
import androidx.compose.material3.Text

View file

@ -14,7 +14,7 @@
* limitations under the License.
*/
package io.element.android.x.designsystem.components
package io.element.android.libraries.designsystem.components
import androidx.compose.material3.Icon
import androidx.compose.material3.LocalContentColor

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 New Vector Ltd
* 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.
@ -14,7 +14,7 @@
* limitations under the License.
*/
package io.element.android.x.designsystem.components.avatar
package io.element.android.libraries.designsystem.components.avatar
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
@ -32,8 +32,8 @@ import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.sp
import coil.compose.AsyncImage
import io.element.android.x.designsystem.AvatarGradientEnd
import io.element.android.x.designsystem.AvatarGradientStart
import io.element.android.libraries.designsystem.AvatarGradientEnd
import io.element.android.libraries.designsystem.AvatarGradientStart
import timber.log.Timber
@Composable

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 New Vector Ltd
* 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.
@ -14,7 +14,7 @@
* limitations under the License.
*/
package io.element.android.x.designsystem.components.avatar
package io.element.android.libraries.designsystem.components.avatar
import androidx.compose.runtime.Immutable

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 New Vector Ltd
* 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.
@ -14,7 +14,7 @@
* limitations under the License.
*/
package io.element.android.x.designsystem.components.avatar
package io.element.android.libraries.designsystem.components.avatar
import androidx.compose.ui.unit.dp

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 New Vector Ltd
* 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.
@ -14,7 +14,7 @@
* limitations under the License.
*/
package io.element.android.x.designsystem.components.dialogs
package io.element.android.libraries.designsystem.components.dialogs
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
@ -29,7 +29,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import io.element.android.x.ui.strings.R as StringR
import io.element.android.libraries.ui.strings.R as StringR
@Composable
fun ConfirmationDialog(

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 New Vector Ltd
* 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.
@ -14,7 +14,7 @@
* limitations under the License.
*/
package io.element.android.x.designsystem.components.dialogs
package io.element.android.libraries.designsystem.components.dialogs
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Row
@ -28,7 +28,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import io.element.android.x.ui.strings.R as StringR
import io.element.android.libraries.ui.strings.R as StringR
@Composable
fun ErrorDialog(

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 New Vector Ltd
* 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.
@ -14,7 +14,7 @@
* limitations under the License.
*/
package io.element.android.x.designsystem.components.preferences
package io.element.android.libraries.designsystem.components.preferences
import androidx.compose.ui.unit.dp

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 New Vector Ltd
* 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.
@ -14,7 +14,7 @@
* limitations under the License.
*/
package io.element.android.x.designsystem.components.preferences
package io.element.android.libraries.designsystem.components.preferences
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.ColumnScope

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 New Vector Ltd
* 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.
@ -14,7 +14,7 @@
* limitations under the License.
*/
package io.element.android.x.designsystem.components.preferences
package io.element.android.libraries.designsystem.components.preferences
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.ColumnScope

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 New Vector Ltd
* 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.
@ -14,7 +14,7 @@
* limitations under the License.
*/
package io.element.android.x.designsystem.components.preferences
package io.element.android.libraries.designsystem.components.preferences
import androidx.annotation.FloatRange
import androidx.compose.foundation.layout.Box
@ -31,8 +31,8 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.tooling.preview.Preview
import io.element.android.x.designsystem.components.preferences.components.PreferenceIcon
import io.element.android.x.designsystem.toEnabledColor
import io.element.android.libraries.designsystem.components.preferences.components.PreferenceIcon
import io.element.android.libraries.designsystem.toEnabledColor
@Composable
fun PreferenceSlide(

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 New Vector Ltd
* 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.
@ -14,7 +14,7 @@
* limitations under the License.
*/
package io.element.android.x.designsystem.components.preferences
package io.element.android.libraries.designsystem.components.preferences
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Box
@ -32,8 +32,8 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.tooling.preview.Preview
import io.element.android.x.designsystem.components.preferences.components.PreferenceIcon
import io.element.android.x.designsystem.toEnabledColor
import io.element.android.libraries.designsystem.components.preferences.components.PreferenceIcon
import io.element.android.libraries.designsystem.toEnabledColor
@Composable
fun PreferenceSwitch(

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 New Vector Ltd
* 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.
@ -14,7 +14,7 @@
* limitations under the License.
*/
package io.element.android.x.designsystem.components.preferences
package io.element.android.libraries.designsystem.components.preferences
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Box
@ -31,7 +31,7 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.tooling.preview.Preview
import io.element.android.x.designsystem.components.preferences.components.PreferenceIcon
import io.element.android.libraries.designsystem.components.preferences.components.PreferenceIcon
@Composable
fun PreferenceText(

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 New Vector Ltd
* 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.
@ -14,7 +14,7 @@
* limitations under the License.
*/
package io.element.android.x.designsystem.components.preferences.components
package io.element.android.libraries.designsystem.components.preferences.components
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.padding
@ -24,7 +24,7 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.unit.dp
import io.element.android.x.designsystem.toEnabledColor
import io.element.android.libraries.designsystem.toEnabledColor
@Composable
fun PreferenceIcon(

View file

@ -14,6 +14,6 @@
* limitations under the License.
*/
package io.element.android.x.di
package io.element.android.libraries.di
abstract class AppScope private constructor()

View file

@ -14,7 +14,7 @@
* limitations under the License.
*/
package io.element.android.x.di
package io.element.android.libraries.di
import javax.inject.Qualifier

View file

@ -14,7 +14,7 @@
* limitations under the License.
*/
package io.element.android.x.di
package io.element.android.libraries.di
/**
* A [DaggerComponentOwner] is anything that "owns" a Dagger Component.

View file

@ -14,6 +14,6 @@
* limitations under the License.
*/
package io.element.android.x.di
package io.element.android.libraries.di
abstract class RoomScope private constructor()

View file

@ -14,6 +14,6 @@
* limitations under the License.
*/
package io.element.android.x.di
package io.element.android.libraries.di
abstract class SessionScope private constructor()

View file

@ -14,7 +14,7 @@
* limitations under the License.
*/
package io.element.android.x.di
package io.element.android.libraries.di
import javax.inject.Scope
import kotlin.reflect.KClass

View file

@ -19,7 +19,7 @@ plugins {
}
android {
namespace = "io.element.android.x.element.resources"
namespace = "io.element.android.element.resources"
}
dependencies {

View file

@ -23,7 +23,7 @@ plugins {
}
android {
namespace = "io.element.android.x.matrix"
namespace = "io.element.android.libraries.matrix"
}
anvil {
@ -31,10 +31,10 @@ anvil {
}
dependencies {
api(project(":libraries:rustsdk"))
implementation(project(":libraries:di"))
api(projects.libraries.rustsdk)
implementation(projects.libraries.di)
implementation(libs.dagger)
implementation(project(":libraries:core"))
implementation(projects.libraries.core)
implementation("net.java.dev.jna:jna:5.13.0@aar")
implementation(libs.androidx.datastore.preferences)
implementation(libs.serialization.json)

View file

@ -14,6 +14,6 @@
* limitations under the License.
*/
package io.element.android.x.matrix
package io.element.android.libraries.matrix
internal const val LOG_TAG = "Matrix"

View file

@ -14,14 +14,14 @@
* limitations under the License.
*/
package io.element.android.x.matrix
package io.element.android.libraries.matrix
import io.element.android.x.matrix.core.RoomId
import io.element.android.x.matrix.core.SessionId
import io.element.android.x.matrix.core.UserId
import io.element.android.x.matrix.media.MediaResolver
import io.element.android.x.matrix.room.MatrixRoom
import io.element.android.x.matrix.room.RoomSummaryDataSource
import io.element.android.libraries.matrix.core.RoomId
import io.element.android.libraries.matrix.core.SessionId
import io.element.android.libraries.matrix.core.UserId
import io.element.android.libraries.matrix.media.MediaResolver
import io.element.android.libraries.matrix.room.MatrixRoom
import io.element.android.libraries.matrix.room.RoomSummaryDataSource
import org.matrix.rustcomponents.sdk.MediaSource
import java.io.Closeable

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 New Vector Ltd
* 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.
@ -14,22 +14,22 @@
* limitations under the License.
*/
package io.element.android.x.matrix
package io.element.android.libraries.matrix
import io.element.android.x.core.coroutine.CoroutineDispatchers
import io.element.android.x.matrix.core.RoomId
import io.element.android.x.matrix.core.SessionId
import io.element.android.x.matrix.core.UserId
import io.element.android.x.matrix.media.MediaResolver
import io.element.android.x.matrix.media.RustMediaResolver
import io.element.android.x.matrix.room.MatrixRoom
import io.element.android.x.matrix.room.RoomSummaryDataSource
import io.element.android.x.matrix.room.RustMatrixRoom
import io.element.android.x.matrix.room.RustRoomSummaryDataSource
import io.element.android.x.matrix.session.PreferencesSessionStore
import io.element.android.x.matrix.session.SessionStore
import io.element.android.x.matrix.session.sessionId
import io.element.android.x.matrix.sync.SlidingSyncObserverProxy
import io.element.android.libraries.core.coroutine.CoroutineDispatchers
import io.element.android.libraries.matrix.core.RoomId
import io.element.android.libraries.matrix.core.SessionId
import io.element.android.libraries.matrix.core.UserId
import io.element.android.libraries.matrix.media.MediaResolver
import io.element.android.libraries.matrix.media.RustMediaResolver
import io.element.android.libraries.matrix.room.MatrixRoom
import io.element.android.libraries.matrix.room.RoomSummaryDataSource
import io.element.android.libraries.matrix.room.RustMatrixRoom
import io.element.android.libraries.matrix.room.RustRoomSummaryDataSource
import io.element.android.libraries.matrix.session.PreferencesSessionStore
import io.element.android.libraries.matrix.session.SessionStore
import io.element.android.libraries.matrix.session.sessionId
import io.element.android.libraries.matrix.sync.SlidingSyncObserverProxy
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.withContext
import org.matrix.rustcomponents.sdk.Client

View file

@ -14,10 +14,10 @@
* limitations under the License.
*/
package io.element.android.x.matrix.auth
package io.element.android.libraries.matrix.auth
import io.element.android.x.matrix.MatrixClient
import io.element.android.x.matrix.core.SessionId
import io.element.android.libraries.matrix.MatrixClient
import io.element.android.libraries.matrix.core.SessionId
import kotlinx.coroutines.flow.Flow
interface MatrixAuthenticationService {

View file

@ -14,17 +14,17 @@
* limitations under the License.
*/
package io.element.android.x.matrix.auth
package io.element.android.libraries.matrix.auth
import com.squareup.anvil.annotations.ContributesBinding
import io.element.android.x.core.coroutine.CoroutineDispatchers
import io.element.android.x.di.AppScope
import io.element.android.x.matrix.MatrixClient
import io.element.android.x.matrix.RustMatrixClient
import io.element.android.x.matrix.core.SessionId
import io.element.android.x.matrix.session.SessionStore
import io.element.android.x.matrix.session.sessionId
import io.element.android.x.matrix.util.logError
import io.element.android.libraries.core.coroutine.CoroutineDispatchers
import io.element.android.libraries.di.AppScope
import io.element.android.libraries.matrix.MatrixClient
import io.element.android.libraries.matrix.RustMatrixClient
import io.element.android.libraries.matrix.core.SessionId
import io.element.android.libraries.matrix.session.SessionStore
import io.element.android.libraries.matrix.session.sessionId
import io.element.android.libraries.matrix.util.logError
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.withContext

View file

@ -14,7 +14,7 @@
* limitations under the License.
*/
package io.element.android.x.matrix.core
package io.element.android.libraries.matrix.core
import java.io.Serializable

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 New Vector Ltd
* 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.
@ -14,9 +14,9 @@
* limitations under the License.
*/
package io.element.android.x.matrix.core
package io.element.android.libraries.matrix.core
import io.element.android.x.matrix.BuildConfig
import io.element.android.libraries.matrix.BuildConfig
import timber.log.Timber
/**

View file

@ -14,7 +14,7 @@
* limitations under the License.
*/
package io.element.android.x.matrix.core
package io.element.android.libraries.matrix.core
import java.io.Serializable

View file

@ -14,7 +14,7 @@
* limitations under the License.
*/
package io.element.android.x.matrix.core
package io.element.android.libraries.matrix.core
import java.io.Serializable

View file

@ -14,7 +14,7 @@
* limitations under the License.
*/
package io.element.android.x.matrix.core
package io.element.android.libraries.matrix.core
import java.io.Serializable

View file

@ -14,13 +14,13 @@
* limitations under the License.
*/
package io.element.android.x.matrix.di
package io.element.android.libraries.matrix.di
import com.squareup.anvil.annotations.ContributesTo
import dagger.Module
import dagger.Provides
import io.element.android.x.di.AppScope
import io.element.android.x.di.SingleIn
import io.element.android.libraries.di.AppScope
import io.element.android.libraries.di.SingleIn
import org.matrix.rustcomponents.sdk.AuthenticationService
import java.io.File

View file

@ -14,7 +14,7 @@
* limitations under the License.
*/
package io.element.android.x.matrix.media
package io.element.android.libraries.matrix.media
import org.matrix.rustcomponents.sdk.MediaSource

View file

@ -14,9 +14,9 @@
* limitations under the License.
*/
package io.element.android.x.matrix.media
package io.element.android.libraries.matrix.media
import io.element.android.x.matrix.MatrixClient
import io.element.android.libraries.matrix.MatrixClient
import org.matrix.rustcomponents.sdk.mediaSourceFromUrl
internal class RustMediaResolver(private val client: MatrixClient) : MediaResolver {

View file

@ -14,7 +14,7 @@
* limitations under the License.
*/
package io.element.android.x.matrix.permalink
package io.element.android.libraries.matrix.permalink
import android.net.Uri

View file

@ -14,7 +14,7 @@
* limitations under the License.
*/
package io.element.android.x.matrix.permalink
package io.element.android.libraries.matrix.permalink
import android.net.Uri

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 New Vector Ltd
* 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.
@ -14,11 +14,11 @@
* limitations under the License.
*/
package io.element.android.x.matrix.permalink
package io.element.android.libraries.matrix.permalink
import android.net.Uri
import android.net.UrlQuerySanitizer
import io.element.android.x.matrix.core.MatrixPatterns
import io.element.android.libraries.matrix.core.MatrixPatterns
import java.net.URLDecoder
import timber.log.Timber

View file

@ -14,11 +14,11 @@
* limitations under the License.
*/
package io.element.android.x.matrix.room
package io.element.android.libraries.matrix.room
import io.element.android.x.matrix.core.EventId
import io.element.android.x.matrix.core.RoomId
import io.element.android.x.matrix.timeline.MatrixTimeline
import io.element.android.libraries.matrix.core.EventId
import io.element.android.libraries.matrix.core.RoomId
import io.element.android.libraries.matrix.timeline.MatrixTimeline
import kotlinx.coroutines.flow.Flow
interface MatrixRoom {

View file

@ -14,7 +14,7 @@
* limitations under the License.
*/
package io.element.android.x.matrix.room
package io.element.android.libraries.matrix.room
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.channels.awaitClose

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 New Vector Ltd
* 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.
@ -14,9 +14,9 @@
* limitations under the License.
*/
package io.element.android.x.matrix.room
package io.element.android.libraries.matrix.room
import io.element.android.x.matrix.core.RoomId
import io.element.android.libraries.matrix.core.RoomId
sealed interface RoomSummary {
data class Empty(val identifier: String) : RoomSummary

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 New Vector Ltd
* 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.
@ -14,11 +14,11 @@
* limitations under the License.
*/
package io.element.android.x.matrix.room
package io.element.android.libraries.matrix.room
import io.element.android.x.core.coroutine.CoroutineDispatchers
import io.element.android.x.matrix.sync.roomListDiff
import io.element.android.x.matrix.sync.state
import io.element.android.libraries.core.coroutine.CoroutineDispatchers
import io.element.android.libraries.matrix.sync.roomListDiff
import io.element.android.libraries.matrix.sync.state
import java.io.Closeable
import java.util.Collections
import java.util.UUID

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 New Vector Ltd
* 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.
@ -14,10 +14,10 @@
* limitations under the License.
*/
package io.element.android.x.matrix.room
package io.element.android.libraries.matrix.room
import io.element.android.x.matrix.core.RoomId
import io.element.android.x.matrix.room.message.RoomMessageFactory
import io.element.android.libraries.matrix.core.RoomId
import io.element.android.libraries.matrix.room.message.RoomMessageFactory
import org.matrix.rustcomponents.sdk.Room
import org.matrix.rustcomponents.sdk.SlidingSyncRoom

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 New Vector Ltd
* 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.
@ -14,13 +14,13 @@
* limitations under the License.
*/
package io.element.android.x.matrix.room
package io.element.android.libraries.matrix.room
import io.element.android.x.core.coroutine.CoroutineDispatchers
import io.element.android.x.matrix.core.EventId
import io.element.android.x.matrix.core.RoomId
import io.element.android.x.matrix.timeline.MatrixTimeline
import io.element.android.x.matrix.timeline.RustMatrixTimeline
import io.element.android.libraries.core.coroutine.CoroutineDispatchers
import io.element.android.libraries.matrix.core.EventId
import io.element.android.libraries.matrix.core.RoomId
import io.element.android.libraries.matrix.timeline.MatrixTimeline
import io.element.android.libraries.matrix.timeline.RustMatrixTimeline
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.filter

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 New Vector Ltd
* 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.
@ -14,10 +14,10 @@
* limitations under the License.
*/
package io.element.android.x.matrix.room.message
package io.element.android.libraries.matrix.room.message
import io.element.android.x.matrix.core.EventId
import io.element.android.x.matrix.core.UserId
import io.element.android.libraries.matrix.core.EventId
import io.element.android.libraries.matrix.core.UserId
data class RoomMessage(
val eventId: EventId,

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 New Vector Ltd
* 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.
@ -14,10 +14,10 @@
* limitations under the License.
*/
package io.element.android.x.matrix.room.message
package io.element.android.libraries.matrix.room.message
import io.element.android.x.matrix.core.EventId
import io.element.android.x.matrix.core.UserId
import io.element.android.libraries.matrix.core.EventId
import io.element.android.libraries.matrix.core.UserId
import org.matrix.rustcomponents.sdk.EventTimelineItem
class RoomMessageFactory {

View file

@ -14,7 +14,7 @@
* limitations under the License.
*/
package io.element.android.x.matrix.session
package io.element.android.libraries.matrix.session
import android.content.Context
import androidx.datastore.core.DataStore
@ -23,9 +23,9 @@ import androidx.datastore.preferences.core.edit
import androidx.datastore.preferences.core.stringPreferencesKey
import androidx.datastore.preferences.preferencesDataStore
import com.squareup.anvil.annotations.ContributesBinding
import io.element.android.x.di.AppScope
import io.element.android.x.di.ApplicationContext
import io.element.android.x.di.SingleIn
import io.element.android.libraries.di.AppScope
import io.element.android.libraries.di.ApplicationContext
import io.element.android.libraries.di.SingleIn
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.firstOrNull
import kotlinx.coroutines.flow.map

View file

@ -14,9 +14,9 @@
* limitations under the License.
*/
package io.element.android.x.matrix.session
package io.element.android.libraries.matrix.session
import io.element.android.x.matrix.core.SessionId
import io.element.android.libraries.matrix.core.SessionId
import org.matrix.rustcomponents.sdk.Session
fun Session.sessionId() = SessionId("${userId}_${deviceId}")

View file

@ -14,7 +14,7 @@
* limitations under the License.
*/
package io.element.android.x.matrix.session
package io.element.android.libraries.matrix.session
import kotlinx.coroutines.flow.Flow
import org.matrix.rustcomponents.sdk.Session

View file

@ -14,9 +14,9 @@
* limitations under the License.
*/
package io.element.android.x.matrix.sync
package io.element.android.libraries.matrix.sync
import io.element.android.x.core.coroutine.CoroutineDispatchers
import io.element.android.libraries.core.coroutine.CoroutineDispatchers
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.flow.MutableSharedFlow
import kotlinx.coroutines.flow.SharedFlow

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 New Vector Ltd
* 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.
@ -14,9 +14,9 @@
* limitations under the License.
*/
package io.element.android.x.matrix.sync
package io.element.android.libraries.matrix.sync
import io.element.android.x.matrix.util.mxCallbackFlow
import io.element.android.libraries.matrix.util.mxCallbackFlow
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.launch

View file

@ -14,9 +14,9 @@
* limitations under the License.
*/
package io.element.android.x.matrix.timeline
package io.element.android.libraries.matrix.timeline
import io.element.android.x.matrix.core.EventId
import io.element.android.libraries.matrix.core.EventId
import kotlinx.coroutines.flow.Flow
import org.matrix.rustcomponents.sdk.TimelineListener

View file

@ -14,7 +14,7 @@
* limitations under the License.
*/
package io.element.android.x.matrix.timeline
package io.element.android.libraries.matrix.timeline
import org.matrix.rustcomponents.sdk.EventTimelineItem
import org.matrix.rustcomponents.sdk.TimelineItem

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2022 New Vector Ltd
* 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.
@ -14,11 +14,11 @@
* limitations under the License.
*/
package io.element.android.x.matrix.timeline
package io.element.android.libraries.matrix.timeline
import io.element.android.x.core.coroutine.CoroutineDispatchers
import io.element.android.x.matrix.core.EventId
import io.element.android.x.matrix.room.RustMatrixRoom
import io.element.android.libraries.core.coroutine.CoroutineDispatchers
import io.element.android.libraries.matrix.core.EventId
import io.element.android.libraries.matrix.room.RustMatrixRoom
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.FlowPreview
import kotlinx.coroutines.flow.Flow

View file

@ -14,7 +14,7 @@
* limitations under the License.
*/
package io.element.android.x.matrix.tracing
package io.element.android.libraries.matrix.tracing
data class TracingConfiguration(
val common: LogLevel = LogLevel.Warn,

View file

@ -14,7 +14,7 @@
* limitations under the License.
*/
package io.element.android.x.matrix.util
package io.element.android.libraries.matrix.util
import kotlinx.coroutines.channels.ProducerScope
import kotlinx.coroutines.channels.awaitClose

View file

@ -14,7 +14,7 @@
* limitations under the License.
*/
package io.element.android.x.matrix.util
package io.element.android.libraries.matrix.util
import org.matrix.rustcomponents.sdk.ClientException
import timber.log.Timber

View file

@ -21,10 +21,10 @@ plugins {
}
android {
namespace = "io.element.android.x.libraries.matrix.test"
namespace = "io.element.android.libraries.matrix.test"
}
dependencies {
api(project(":libraries:matrix"))
api(projects.libraries.matrix)
api(libs.coroutines.core)
}

View file

@ -14,18 +14,18 @@
* limitations under the License.
*/
package io.element.android.x.libraries.matrixtest
package io.element.android.libraries.matrixtest
import io.element.android.x.matrix.MatrixClient
import io.element.android.x.matrix.core.RoomId
import io.element.android.x.matrix.core.SessionId
import io.element.android.x.matrix.core.UserId
import io.element.android.x.libraries.matrixtest.media.FakeMediaResolver
import io.element.android.x.matrix.media.MediaResolver
import io.element.android.x.libraries.matrixtest.room.FakeMatrixRoom
import io.element.android.x.libraries.matrixtest.room.InMemoryRoomSummaryDataSource
import io.element.android.x.matrix.room.MatrixRoom
import io.element.android.x.matrix.room.RoomSummaryDataSource
import io.element.android.libraries.matrix.MatrixClient
import io.element.android.libraries.matrix.core.RoomId
import io.element.android.libraries.matrix.core.SessionId
import io.element.android.libraries.matrix.core.UserId
import io.element.android.libraries.matrixtest.media.FakeMediaResolver
import io.element.android.libraries.matrix.media.MediaResolver
import io.element.android.libraries.matrixtest.room.FakeMatrixRoom
import io.element.android.libraries.matrixtest.room.InMemoryRoomSummaryDataSource
import io.element.android.libraries.matrix.room.MatrixRoom
import io.element.android.libraries.matrix.room.RoomSummaryDataSource
import org.matrix.rustcomponents.sdk.MediaSource
class FakeMatrixClient(override val sessionId: SessionId) : MatrixClient {

View file

@ -14,9 +14,9 @@
* limitations under the License.
*/
package io.element.android.x.libraries.matrixtest.media
package io.element.android.libraries.matrixtest.media
import io.element.android.x.matrix.media.MediaResolver
import io.element.android.libraries.matrix.media.MediaResolver
class FakeMediaResolver : MediaResolver {
override suspend fun resolve(url: String?, kind: MediaResolver.Kind): ByteArray? {

View file

@ -14,13 +14,13 @@
* limitations under the License.
*/
package io.element.android.x.libraries.matrixtest.room
package io.element.android.libraries.matrixtest.room
import io.element.android.x.matrix.core.EventId
import io.element.android.x.matrix.core.RoomId
import io.element.android.x.matrix.room.MatrixRoom
import io.element.android.x.libraries.matrixtest.timeline.FakeMatrixTimeline
import io.element.android.x.matrix.timeline.MatrixTimeline
import io.element.android.libraries.matrix.core.EventId
import io.element.android.libraries.matrix.core.RoomId
import io.element.android.libraries.matrix.room.MatrixRoom
import io.element.android.libraries.matrixtest.timeline.FakeMatrixTimeline
import io.element.android.libraries.matrix.timeline.MatrixTimeline
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.emptyFlow

View file

@ -14,10 +14,10 @@
* limitations under the License.
*/
package io.element.android.x.libraries.matrixtest.room
package io.element.android.libraries.matrixtest.room
import io.element.android.x.matrix.room.RoomSummary
import io.element.android.x.matrix.room.RoomSummaryDataSource
import io.element.android.libraries.matrix.room.RoomSummary
import io.element.android.libraries.matrix.room.RoomSummaryDataSource
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.emptyFlow

Some files were not shown because too many files have changed in this diff Show more