Fix ktlint issues
This commit is contained in:
@@ -58,7 +58,6 @@ import java.io.File
|
||||
*/
|
||||
@AutoService(CodeGenerator::class)
|
||||
class ContributesNodeCodeGenerator : CodeGenerator {
|
||||
|
||||
override fun isApplicable(context: AnvilContext): Boolean = true
|
||||
|
||||
override fun generateCode(codeGenDir: File, module: ModuleDescriptor, projectFiles: Collection<KtFile>): Collection<GeneratedFile> {
|
||||
|
||||
@@ -27,7 +27,6 @@ import io.element.android.x.initializer.CrashInitializer
|
||||
import io.element.android.x.initializer.TracingInitializer
|
||||
|
||||
class ElementXApplication : Application(), DaggerComponentOwner {
|
||||
|
||||
override val daggerComponent: AppComponent = DaggerAppComponent.factory().create(this)
|
||||
|
||||
override fun onCreate() {
|
||||
|
||||
@@ -51,7 +51,6 @@ import timber.log.Timber
|
||||
private val loggerTag = LoggerTag("MainActivity")
|
||||
|
||||
class MainActivity : NodeActivity() {
|
||||
|
||||
private lateinit var mainNode: MainNode
|
||||
private lateinit var appBindings: AppBindings
|
||||
|
||||
|
||||
@@ -48,7 +48,6 @@ class MainNode(
|
||||
plugins = plugins,
|
||||
),
|
||||
DaggerComponentOwner {
|
||||
|
||||
override val daggerComponent = (context as DaggerComponentOwner).daggerComponent
|
||||
|
||||
override fun resolve(navTarget: RootNavTarget, buildContext: BuildContext): Node {
|
||||
|
||||
@@ -27,8 +27,12 @@ import io.element.android.libraries.matrix.api.tracing.TracingService
|
||||
@ContributesTo(AppScope::class)
|
||||
interface AppBindings {
|
||||
fun snackbarDispatcher(): SnackbarDispatcher
|
||||
|
||||
fun tracingService(): TracingService
|
||||
|
||||
fun bugReporter(): BugReporter
|
||||
|
||||
fun lockScreenService(): LockScreenService
|
||||
|
||||
fun preferencesStore(): PreferencesStore
|
||||
}
|
||||
|
||||
@@ -28,7 +28,6 @@ import io.element.android.libraries.di.SingleIn
|
||||
@SingleIn(AppScope::class)
|
||||
@MergeComponent(AppScope::class)
|
||||
interface AppComponent : NodeFactoriesBindings {
|
||||
|
||||
@Component.Factory
|
||||
interface Factory {
|
||||
fun create(
|
||||
|
||||
@@ -46,7 +46,6 @@ import java.io.File
|
||||
@Module
|
||||
@ContributesTo(AppScope::class)
|
||||
object AppModule {
|
||||
|
||||
@Provides
|
||||
fun providesBaseDirectory(@ApplicationContext context: Context): File {
|
||||
return File(context.filesDir, "sessions")
|
||||
@@ -82,14 +81,20 @@ object AppModule {
|
||||
buildType = buildType,
|
||||
applicationName = context.getString(R.string.app_name),
|
||||
applicationId = BuildConfig.APPLICATION_ID,
|
||||
lowPrivacyLoggingEnabled = false, // TODO EAx Config.LOW_PRIVACY_LOG_ENABLE,
|
||||
// TODO EAx Config.LOW_PRIVACY_LOG_ENABLE,
|
||||
lowPrivacyLoggingEnabled = false,
|
||||
versionName = BuildConfig.VERSION_NAME,
|
||||
versionCode = BuildConfig.VERSION_CODE,
|
||||
gitRevision = "TODO", // BuildConfig.GIT_REVISION,
|
||||
gitRevisionDate = "TODO", // BuildConfig.GIT_REVISION_DATE,
|
||||
gitBranchName = "TODO", // BuildConfig.GIT_BRANCH_NAME,
|
||||
flavorDescription = "TODO", // BuildConfig.FLAVOR_DESCRIPTION,
|
||||
flavorShortDescription = "TODO", // BuildConfig.SHORT_FLAVOR_DESCRIPTION,
|
||||
// BuildConfig.GIT_REVISION,
|
||||
gitRevision = "TODO",
|
||||
// BuildConfig.GIT_REVISION_DATE,
|
||||
gitRevisionDate = "TODO",
|
||||
// BuildConfig.GIT_BRANCH_NAME,
|
||||
gitBranchName = "TODO",
|
||||
// BuildConfig.FLAVOR_DESCRIPTION,
|
||||
flavorDescription = "TODO",
|
||||
// BuildConfig.SHORT_FLAVOR_DESCRIPTION,
|
||||
flavorShortDescription = "TODO",
|
||||
)
|
||||
|
||||
@Provides
|
||||
|
||||
@@ -26,7 +26,6 @@ import javax.inject.Inject
|
||||
class DefaultRoomComponentFactory @Inject constructor(
|
||||
private val roomComponentBuilder: RoomComponent.Builder
|
||||
) : RoomComponentFactory {
|
||||
|
||||
override fun create(room: MatrixRoom): Any {
|
||||
return roomComponentBuilder.room(room).build()
|
||||
}
|
||||
|
||||
@@ -26,7 +26,6 @@ import javax.inject.Inject
|
||||
class DefaultSessionComponentFactory @Inject constructor(
|
||||
private val sessionComponentBuilder: SessionComponent.Builder
|
||||
) : SessionComponentFactory {
|
||||
|
||||
override fun create(client: MatrixClient): Any {
|
||||
return sessionComponentBuilder.client(client).build()
|
||||
}
|
||||
|
||||
@@ -29,7 +29,6 @@ import io.element.android.libraries.matrix.api.room.MatrixRoom
|
||||
@SingleIn(RoomScope::class)
|
||||
@MergeSubcomponent(RoomScope::class)
|
||||
interface RoomComponent : NodeFactoriesBindings {
|
||||
|
||||
@Subcomponent.Builder
|
||||
interface Builder {
|
||||
@BindsInstance
|
||||
|
||||
@@ -29,7 +29,6 @@ import io.element.android.libraries.matrix.api.MatrixClient
|
||||
@SingleIn(SessionScope::class)
|
||||
@MergeSubcomponent(SessionScope::class)
|
||||
interface SessionComponent : NodeFactoriesBindings {
|
||||
|
||||
@Subcomponent.Builder
|
||||
interface Builder {
|
||||
@BindsInstance
|
||||
|
||||
@@ -21,7 +21,6 @@ import androidx.startup.Initializer
|
||||
import io.element.android.features.rageshake.impl.crash.VectorUncaughtExceptionHandler
|
||||
|
||||
class CrashInitializer : Initializer<Unit> {
|
||||
|
||||
override fun create(context: Context) {
|
||||
VectorUncaughtExceptionHandler(context).activate()
|
||||
}
|
||||
|
||||
@@ -31,7 +31,6 @@ import io.element.android.x.di.AppBindings
|
||||
import timber.log.Timber
|
||||
|
||||
class TracingInitializer : Initializer<Unit> {
|
||||
|
||||
override fun create(context: Context) {
|
||||
val appBindings = context.bindings<AppBindings>()
|
||||
val tracingService = appBindings.tracingService()
|
||||
|
||||
@@ -31,7 +31,6 @@ import org.robolectric.RuntimeEnvironment
|
||||
|
||||
@RunWith(RobolectricTestRunner::class)
|
||||
class IntentProviderImplTest {
|
||||
|
||||
@Test
|
||||
fun `test getViewRoomIntent with Session`() {
|
||||
val sut = createIntentProviderImpl()
|
||||
|
||||
@@ -46,7 +46,6 @@ data class LockScreenConfig(
|
||||
@ContributesTo(AppScope::class)
|
||||
@Module
|
||||
object LockScreenConfigModule {
|
||||
|
||||
@Provides
|
||||
fun providesLockScreenConfig(): LockScreenConfig = LockScreenConfig(
|
||||
isPinMandatory = false,
|
||||
|
||||
@@ -17,6 +17,6 @@
|
||||
package io.element.android.appconfig
|
||||
|
||||
object MatrixConfiguration {
|
||||
const val matrixToPermalinkBaseUrl: String = "https://matrix.to/#/"
|
||||
const val MATRIX_TO_PERMALINK_BASE_URL: String = "https://matrix.to/#/"
|
||||
val clientPermalinkBaseUrl: String? = null
|
||||
}
|
||||
|
||||
@@ -18,8 +18,8 @@ package io.element.android.appconfig
|
||||
|
||||
object NotificationConfig {
|
||||
// TODO EAx Implement and set to true at some point
|
||||
const val supportMarkAsReadAction = false
|
||||
const val SUPPORT_MARK_AS_READ_ACTION = false
|
||||
|
||||
// TODO EAx Implement and set to true at some point
|
||||
const val supportQuickReplyAction = false
|
||||
const val SUPPORT_QUICK_REPLY_ACTION = false
|
||||
}
|
||||
|
||||
@@ -20,5 +20,5 @@ object PushConfig {
|
||||
/**
|
||||
* Note: pusher_app_id cannot exceed 64 chars.
|
||||
*/
|
||||
const val pusher_app_id: String = "im.vector.app.android"
|
||||
const val PUSHER_APP_ID: String = "im.vector.app.android"
|
||||
}
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
package io.element.android.appconfig
|
||||
|
||||
object RoomListConfig {
|
||||
const val showInviteMenuItem = false
|
||||
const val showReportProblemMenuItem = false
|
||||
const val SHOW_INVITE_MENU_ITEM = false
|
||||
const val SHOW_REPORT_PROBLEM_MENU_ITEM = false
|
||||
|
||||
const val hasDropdownMenu = showInviteMenuItem || showReportProblemMenuItem
|
||||
const val HAS_DROP_DOWN_MENU = SHOW_INVITE_MENU_ITEM || SHOW_REPORT_PROBLEM_MENU_ITEM
|
||||
}
|
||||
|
||||
@@ -17,5 +17,5 @@
|
||||
package io.element.android.appconfig
|
||||
|
||||
object SecureBackupConfig {
|
||||
const val LearnMoreUrl: String = "https://element.io/help#encryption5"
|
||||
const val LEARN_MORE_URL: String = "https://element.io/help#encryption5"
|
||||
}
|
||||
|
||||
@@ -17,5 +17,5 @@
|
||||
package io.element.android.appconfig
|
||||
|
||||
object TimelineConfig {
|
||||
const val maxReadReceiptToDisplay = 3
|
||||
const val MAX_READ_RECEIPT_TO_DISPLAY = 3
|
||||
}
|
||||
|
||||
@@ -36,7 +36,6 @@ class LoggedInEventProcessor @Inject constructor(
|
||||
roomMembershipObserver: RoomMembershipObserver,
|
||||
sessionVerificationService: SessionVerificationService,
|
||||
) {
|
||||
|
||||
private var observingJob: Job? = null
|
||||
|
||||
private val displayLeftRoomMessage = roomMembershipObserver.updates
|
||||
|
||||
@@ -111,7 +111,6 @@ class LoggedInFlowNode @AssistedInject constructor(
|
||||
buildContext = buildContext,
|
||||
plugins = plugins
|
||||
) {
|
||||
|
||||
interface Callback : Plugin {
|
||||
fun onOpenBugReport()
|
||||
}
|
||||
|
||||
@@ -81,7 +81,6 @@ class RootFlowNode @AssistedInject constructor(
|
||||
buildContext = buildContext,
|
||||
plugins = plugins
|
||||
) {
|
||||
|
||||
override fun onBuilt() {
|
||||
matrixClientsHolder.restoreWithSavedState(buildContext.savedStateMap)
|
||||
super.onBuilt()
|
||||
|
||||
@@ -37,7 +37,6 @@ private const val SAVE_INSTANCE_KEY = "io.element.android.x.di.MatrixClientsHold
|
||||
@SingleIn(AppScope::class)
|
||||
@ContributesBinding(AppScope::class)
|
||||
class MatrixClientsHolder @Inject constructor(private val authenticationService: MatrixAuthenticationService) : MatrixClientProvider {
|
||||
|
||||
private val sessionIdsToMatrixClient = ConcurrentHashMap<SessionId, MatrixClient>()
|
||||
private val restoreMutex = Mutex()
|
||||
|
||||
|
||||
@@ -1,21 +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.appnav.loggedin
|
||||
|
||||
// sealed interface LoggedInEvents {
|
||||
// data object MyEvent : LoggedInEvents
|
||||
// }
|
||||
@@ -35,7 +35,6 @@ class LoggedInNode @AssistedInject constructor(
|
||||
buildContext = buildContext,
|
||||
plugins = plugins
|
||||
) {
|
||||
|
||||
@Composable
|
||||
override fun View(modifier: Modifier) {
|
||||
val loggedInState = loggedInPresenter.present()
|
||||
|
||||
@@ -35,7 +35,6 @@ class LoggedInPresenter @Inject constructor(
|
||||
private val networkMonitor: NetworkMonitor,
|
||||
private val pushService: PushService,
|
||||
) : Presenter<LoggedInState> {
|
||||
|
||||
@Composable
|
||||
override fun present(): LoggedInState {
|
||||
LaunchedEffect(Unit) {
|
||||
|
||||
@@ -47,7 +47,6 @@ open class LoadingRoomStateProvider : PreviewParameterProvider<LoadingRoomState>
|
||||
|
||||
@SingleIn(SessionScope::class)
|
||||
class LoadingRoomStateFlowFactory @Inject constructor(private val matrixClient: MatrixClient) {
|
||||
|
||||
fun create(lifecycleScope: CoroutineScope, roomId: RoomId): StateFlow<LoadingRoomState> =
|
||||
getRoomFlow(roomId)
|
||||
.map { room ->
|
||||
|
||||
@@ -66,7 +66,6 @@ class RoomFlowNode @AssistedInject constructor(
|
||||
buildContext = buildContext,
|
||||
plugins = plugins
|
||||
) {
|
||||
|
||||
data class Inputs(
|
||||
val roomId: RoomId,
|
||||
val initialElement: RoomLoadedFlowNode.NavTarget = RoomLoadedFlowNode.NavTarget.Messages,
|
||||
|
||||
@@ -71,7 +71,6 @@ class RoomLoadedFlowNode @AssistedInject constructor(
|
||||
buildContext = buildContext,
|
||||
plugins = plugins,
|
||||
), DaggerComponentOwner {
|
||||
|
||||
interface Callback : Plugin {
|
||||
fun onOpenRoom(roomId: RoomId)
|
||||
fun onForwardedToSingleRoom(roomId: RoomId)
|
||||
|
||||
@@ -41,7 +41,6 @@ class RootNavStateFlowFactory @Inject constructor(
|
||||
private val matrixClientsHolder: MatrixClientsHolder,
|
||||
private val loginUserStory: LoginUserStory,
|
||||
) {
|
||||
|
||||
private var currentCacheIndex = 0
|
||||
|
||||
fun create(savedStateMap: SavedStateMap?): Flow<RootNavState> {
|
||||
|
||||
@@ -30,7 +30,6 @@ class RootPresenter @Inject constructor(
|
||||
private val rageshakeDetectionPresenter: RageshakeDetectionPresenter,
|
||||
private val appErrorStateService: AppErrorStateService,
|
||||
) : Presenter<RootState> {
|
||||
|
||||
@Composable
|
||||
override fun present(): RootState {
|
||||
val rageshakeDetectionState = rageshakeDetectionPresenter.present()
|
||||
|
||||
@@ -41,7 +41,6 @@ import org.junit.Rule
|
||||
import org.junit.Test
|
||||
|
||||
class RoomFlowNodeTest {
|
||||
|
||||
@get:Rule
|
||||
val instantTaskExecutorRule = InstantTaskExecutorRule()
|
||||
|
||||
@@ -49,7 +48,6 @@ class RoomFlowNodeTest {
|
||||
val mainDispatcherRule = MainDispatcherRule()
|
||||
|
||||
private class FakeMessagesEntryPoint : MessagesEntryPoint {
|
||||
|
||||
var nodeId: String? = null
|
||||
var callback: MessagesEntryPoint.Callback? = null
|
||||
|
||||
@@ -68,12 +66,10 @@ class RoomFlowNodeTest {
|
||||
}
|
||||
|
||||
private class FakeRoomDetailsEntryPoint : RoomDetailsEntryPoint {
|
||||
|
||||
var nodeId: String? = null
|
||||
|
||||
override fun nodeBuilder(parentNode: Node, buildContext: BuildContext): RoomDetailsEntryPoint.NodeBuilder {
|
||||
return object : RoomDetailsEntryPoint.NodeBuilder {
|
||||
|
||||
override fun params(params: RoomDetailsEntryPoint.Params): RoomDetailsEntryPoint.NodeBuilder {
|
||||
return this
|
||||
}
|
||||
|
||||
@@ -36,7 +36,6 @@ import org.junit.Rule
|
||||
import org.junit.Test
|
||||
|
||||
class LoggedInPresenterTest {
|
||||
|
||||
@get:Rule
|
||||
val warmUpRule = WarmUpRule()
|
||||
|
||||
|
||||
@@ -28,7 +28,6 @@ import kotlinx.coroutines.test.runTest
|
||||
import org.junit.Test
|
||||
|
||||
class LoadingRoomStateFlowFactoryTest {
|
||||
|
||||
@Test
|
||||
fun `flow should emit Loading and then Loaded when there is a room in cache`() = runTest {
|
||||
val room = FakeMatrixRoom(sessionId = A_SESSION_ID, roomId = A_ROOM_ID)
|
||||
|
||||
@@ -100,8 +100,8 @@ allprojects {
|
||||
kotlinOptions.allWarningsAsErrors = project.properties["allWarningsAsErrors"] == "true"
|
||||
|
||||
kotlinOptions {
|
||||
// Uncomment to suppress Compose Kotlin compiler compatibility warning
|
||||
/*
|
||||
// Uncomment to suppress Compose Kotlin compiler compatibility warning
|
||||
freeCompilerArgs += listOf(
|
||||
"-P",
|
||||
"plugin:androidx.compose.compiler.plugins.kotlin:suppressKotlinVersionCompatibilityCheck=true"
|
||||
@@ -194,7 +194,7 @@ subprojects {
|
||||
|
||||
// Workaround for https://github.com/airbnb/Showkase/issues/335
|
||||
subprojects {
|
||||
tasks.withType<KspTask>() {
|
||||
tasks.withType<KspTask> {
|
||||
doLast {
|
||||
fileTree(layout.buildDirectory).apply { include("**/*ShowkaseExtension*.kt") }.files.forEach { file ->
|
||||
ReplaceRegExp().apply {
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -28,7 +28,6 @@ data class WidgetMessage(
|
||||
@SerialName("action") val action: Action,
|
||||
@SerialName("data") val data: JsonElement? = null,
|
||||
) {
|
||||
|
||||
@Serializable
|
||||
enum class Direction {
|
||||
@SerialName("fromWidget")
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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? {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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> {
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -48,7 +48,6 @@ import org.junit.Rule
|
||||
import org.junit.Test
|
||||
|
||||
class CallScreenPresenterTest {
|
||||
|
||||
@get:Rule
|
||||
val warmUpRule = WarmUpRule()
|
||||
|
||||
|
||||
@@ -24,7 +24,6 @@ import java.net.URLEncoder
|
||||
|
||||
@RunWith(RobolectricTestRunner::class)
|
||||
class CallIntentDataParserTest {
|
||||
|
||||
private val callIntentDataParser = CallIntentDataParser()
|
||||
|
||||
@Test
|
||||
|
||||
@@ -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")) })
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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,
|
||||
)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -69,7 +69,7 @@ class SecureBackupRootNode @AssistedInject constructor(
|
||||
}
|
||||
|
||||
private fun onLearnMoreClicked(uriHandler: UriHandler) {
|
||||
uriHandler.openUri(SecureBackupConfig.LearnMoreUrl)
|
||||
uriHandler.openUri(SecureBackupConfig.LEARN_MORE_URL)
|
||||
}
|
||||
|
||||
@Composable
|
||||
|
||||
@@ -31,7 +31,6 @@ import javax.inject.Inject
|
||||
class AndroidClipboardHelper @Inject constructor(
|
||||
@ApplicationContext private val context: Context,
|
||||
) : ClipboardHelper {
|
||||
|
||||
private val clipboardManager = requireNotNull(context.getSystemService<ClipboardManager>())
|
||||
|
||||
override fun copyPlainText(text: String) {
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
package io.element.android.libraries.androidutils.clipboard
|
||||
|
||||
class FakeClipboardHelper : ClipboardHelper {
|
||||
|
||||
var clipboardContents: Any? = null
|
||||
|
||||
override fun copyPlainText(text: String) {
|
||||
|
||||
@@ -26,7 +26,6 @@ internal class DefaultDiffCallback<T>(
|
||||
private val newList: List<T>,
|
||||
private val areItemsTheSame: (oldItem: T?, newItem: T?) -> Boolean,
|
||||
) : DiffUtil.Callback() {
|
||||
|
||||
override fun getOldListSize(): Int {
|
||||
return oldList.size
|
||||
}
|
||||
|
||||
@@ -40,7 +40,6 @@ interface MutableDiffCache<E> : DiffCache<E> {
|
||||
*
|
||||
*/
|
||||
class MutableListDiffCache<E>(private val mutableList: MutableList<E?> = ArrayList()) : MutableDiffCache<E> {
|
||||
|
||||
override fun removeAt(index: Int): E? {
|
||||
return mutableList.removeAt(index)
|
||||
}
|
||||
|
||||
@@ -36,7 +36,6 @@ interface DiffCacheInvalidator<T> {
|
||||
* It invalidates the cache by setting values to null.
|
||||
*/
|
||||
class DefaultDiffCacheInvalidator<T> : DiffCacheInvalidator<T> {
|
||||
|
||||
override fun onChanged(position: Int, count: Int, cache: MutableDiffCache<T>) {
|
||||
for (i in position until position + count) {
|
||||
// Invalidate cache
|
||||
|
||||
@@ -36,7 +36,6 @@ class DiffCacheUpdater<ListItem, CachedItem>(
|
||||
private val cacheInvalidator: DiffCacheInvalidator<CachedItem> = DefaultDiffCacheInvalidator(),
|
||||
private val areItemsTheSame: (oldItem: ListItem?, newItem: ListItem?) -> Boolean,
|
||||
) {
|
||||
|
||||
private val lock = Object()
|
||||
private var prevOriginalList: List<ListItem> = emptyList()
|
||||
|
||||
|
||||
@@ -27,7 +27,6 @@ import kotlin.contracts.contract
|
||||
*/
|
||||
@Stable
|
||||
sealed interface AsyncAction<out T> {
|
||||
|
||||
/**
|
||||
* Represents an uninitialized operation (i.e. yet to be run by the user).
|
||||
*/
|
||||
|
||||
@@ -27,7 +27,6 @@ import kotlin.contracts.contract
|
||||
*/
|
||||
@Stable
|
||||
sealed interface AsyncData<out T> {
|
||||
|
||||
/**
|
||||
* Represents a failed operation.
|
||||
*
|
||||
|
||||
@@ -25,7 +25,6 @@ import kotlinx.coroutines.flow.map
|
||||
|
||||
class HideOverlayBackPressHandler<NavTarget : Any> :
|
||||
BaseBackPressHandlerStrategy<NavTarget, BackStack.State>() {
|
||||
|
||||
override val canHandleBackPressFlow: Flow<Boolean> by lazy {
|
||||
navModel.elements.map(::areThereElements)
|
||||
}
|
||||
|
||||
@@ -40,7 +40,6 @@ class Overlay<NavTarget : Any>(
|
||||
savedStateMap = savedStateMap,
|
||||
key = key,
|
||||
) {
|
||||
|
||||
override val initialElements: NavElements<NavTarget, BackStack.State>
|
||||
get() = emptyList()
|
||||
}
|
||||
|
||||
@@ -24,7 +24,6 @@ import kotlinx.parcelize.Parcelize
|
||||
|
||||
@Parcelize
|
||||
class Hide<T : Any> : OverlayOperation<T> {
|
||||
|
||||
override fun isApplicable(elements: BackStackElements<T>): Boolean =
|
||||
elements.any { it.targetState == BackStack.State.ACTIVE }
|
||||
|
||||
|
||||
@@ -29,7 +29,6 @@ import kotlinx.parcelize.RawValue
|
||||
data class Show<T : Any>(
|
||||
private val element: @RawValue T
|
||||
) : OverlayOperation<T> {
|
||||
|
||||
override fun isApplicable(elements: BackStackElements<T>): Boolean =
|
||||
element != elements.activeElement
|
||||
|
||||
|
||||
@@ -84,7 +84,6 @@ class AsyncDataKtTest {
|
||||
private class TestableMutableState<T>(
|
||||
value: T
|
||||
) : MutableState<T> {
|
||||
|
||||
@Suppress("ktlint:standard:property-naming")
|
||||
private val _deque = ArrayDeque<T>(listOf(value))
|
||||
|
||||
|
||||
@@ -21,7 +21,6 @@ package io.element.android.libraries.core.cache
|
||||
* This class is not thread safe.
|
||||
*/
|
||||
class CircularCache<T : Any>(cacheSize: Int, factory: (Int) -> Array<T?>) {
|
||||
|
||||
companion object {
|
||||
inline fun <reified T : Any> create(cacheSize: Int) = CircularCache(cacheSize) { Array<T?>(cacheSize) { null } }
|
||||
}
|
||||
|
||||
@@ -26,20 +26,6 @@ inline fun <T> T.ooi(block: (T) -> Unit): T = also(block)
|
||||
*/
|
||||
fun CharSequence?.orEmpty() = this ?: ""
|
||||
|
||||
/**
|
||||
* Check if a CharSequence is a phone number.
|
||||
*/
|
||||
/*
|
||||
fun CharSequence.isMsisdn(): Boolean {
|
||||
return try {
|
||||
PhoneNumberUtil.getInstance().parse(ensurePrefix("+"), null)
|
||||
true
|
||||
} catch (e: NumberParseException) {
|
||||
false
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
/**
|
||||
* Useful to append a String at the end of a filename but before the extension if any
|
||||
* Ex:
|
||||
|
||||
@@ -23,7 +23,6 @@ package io.element.android.libraries.core.log.logger
|
||||
* Timber.tag(loggerTag.value).v("My log message")
|
||||
*/
|
||||
open class LoggerTag(name: String, parentTag: LoggerTag? = null) {
|
||||
|
||||
object PushLoggerTag : LoggerTag("Push")
|
||||
object NotificationLoggerTag : LoggerTag("Notification", PushLoggerTag)
|
||||
|
||||
|
||||
@@ -20,7 +20,6 @@ import org.junit.Assert.assertEquals
|
||||
import org.junit.Test
|
||||
|
||||
class BasicExtensionsTest {
|
||||
|
||||
@Test(expected = IllegalArgumentException::class)
|
||||
fun `test ellipsize at 0`() {
|
||||
"1234567890".ellipsize(0)
|
||||
|
||||
@@ -20,7 +20,6 @@ import com.google.common.truth.Truth.assertThat
|
||||
import org.junit.Test
|
||||
|
||||
class ResultTest {
|
||||
|
||||
@Test
|
||||
fun testFlatMap() {
|
||||
val initial = Result.success("initial")
|
||||
|
||||
@@ -23,7 +23,6 @@ import io.element.android.libraries.matrix.test.A_THREAD_ID
|
||||
import org.junit.Test
|
||||
|
||||
class DeepLinkCreatorTest {
|
||||
|
||||
@Test
|
||||
fun room() {
|
||||
val sut = DeepLinkCreator()
|
||||
|
||||
@@ -25,7 +25,6 @@ data class AvatarData(
|
||||
val url: String? = null,
|
||||
val size: AvatarSize,
|
||||
) {
|
||||
|
||||
val initial by lazy {
|
||||
(name?.takeIf { it.isNotBlank() } ?: id)
|
||||
.let { dn ->
|
||||
|
||||
@@ -29,7 +29,6 @@ import io.element.android.libraries.designsystem.theme.components.TextButton
|
||||
*/
|
||||
@Immutable
|
||||
sealed interface ButtonVisuals {
|
||||
|
||||
val action: () -> Unit
|
||||
|
||||
/**
|
||||
|
||||
@@ -29,7 +29,8 @@ import androidx.lifecycle.Lifecycle
|
||||
* Inspired from https://stackoverflow.com/questions/68847559/how-can-i-detect-keyboard-opening-and-closing-in-jetpack-compose
|
||||
*/
|
||||
enum class Keyboard {
|
||||
Opened, Closed
|
||||
Opened,
|
||||
Closed
|
||||
}
|
||||
|
||||
// Note: it does not work as expected...
|
||||
|
||||
@@ -95,7 +95,6 @@ private fun PreferenceTopAppBar(
|
||||
overflow = TextOverflow.Ellipsis
|
||||
)
|
||||
}
|
||||
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ fun PreferenceTextField(
|
||||
style: ListItemStyle = ListItemStyle.Default,
|
||||
) {
|
||||
var displayTextFieldDialog by rememberSaveable { mutableStateOf(false) }
|
||||
val valueToDisplay = if (displayValue(value)) { value } else supportingText
|
||||
val valueToDisplay = if (displayValue(value)) value else supportingText
|
||||
|
||||
ListItem(
|
||||
modifier = modifier,
|
||||
|
||||
@@ -259,11 +259,14 @@ sealed interface IconSource {
|
||||
}
|
||||
|
||||
enum class ButtonSize {
|
||||
Medium, Large
|
||||
Medium,
|
||||
Large
|
||||
}
|
||||
|
||||
internal enum class ButtonStyle {
|
||||
Filled, Outlined, Text;
|
||||
Filled,
|
||||
Outlined,
|
||||
Text;
|
||||
|
||||
@Composable
|
||||
fun getColors(destructive: Boolean): ButtonColors = when (this) {
|
||||
|
||||
@@ -38,7 +38,8 @@ import io.element.android.libraries.designsystem.preview.PreviewGroup
|
||||
fun FloatingActionButton(
|
||||
onClick: () -> Unit,
|
||||
modifier: Modifier = Modifier,
|
||||
shape: Shape = CircleShape, // FloatingActionButtonDefaults.shape,
|
||||
// FloatingActionButtonDefaults.shape
|
||||
shape: Shape = CircleShape,
|
||||
containerColor: Color = FloatingActionButtonDefaults.containerColor,
|
||||
contentColor: Color = contentColorFor(containerColor),
|
||||
elevation: FloatingActionButtonElevation = FloatingActionButtonDefaults.elevation(),
|
||||
|
||||
@@ -378,7 +378,6 @@ internal fun ListItemDisabledWithIconPreview() = PreviewItems.OneLineListItemPre
|
||||
|
||||
@Suppress("ModifierMissing")
|
||||
private object PreviewItems {
|
||||
|
||||
@Composable
|
||||
fun ThreeLinesListItemPreview(
|
||||
modifier: Modifier = Modifier,
|
||||
|
||||
@@ -81,7 +81,6 @@ fun ListSupportingText(
|
||||
}
|
||||
|
||||
object ListSupportingTextDefaults {
|
||||
|
||||
/** Specifies the padding to use for the supporting text. */
|
||||
@Immutable
|
||||
sealed interface Padding {
|
||||
|
||||
@@ -151,7 +151,6 @@ fun <T> SearchBar(
|
||||
}
|
||||
|
||||
object ElementSearchBarDefaults {
|
||||
|
||||
@OptIn(ExperimentalMaterial3Api::class)
|
||||
@Composable
|
||||
fun inactiveColors() = SearchBarDefaults.colors(
|
||||
|
||||
@@ -37,7 +37,7 @@ fun Slider(
|
||||
modifier: Modifier = Modifier,
|
||||
enabled: Boolean = true,
|
||||
valueRange: ClosedFloatingPointRange<Float> = 0f..1f,
|
||||
/*@IntRange(from = 0)*/
|
||||
// @IntRange(from = 0)
|
||||
steps: Int = 0,
|
||||
onValueChangeFinished: (() -> Unit)? = null,
|
||||
colors: SliderColors = SliderDefaults.colors(),
|
||||
|
||||
@@ -282,11 +282,13 @@ private fun CustomStandardBottomSheet(
|
||||
if (anchoredDraggableState.anchors.size > 1 && sheetSwipeEnabled) {
|
||||
if (currentValue == SheetValue.PartiallyExpanded) {
|
||||
expand(expandActionLabel) {
|
||||
scope.launch { expand() }; true
|
||||
scope.launch { expand() }
|
||||
true
|
||||
}
|
||||
} else {
|
||||
collapse(partialExpandActionLabel) {
|
||||
scope.launch { partialExpand() }; true
|
||||
scope.launch { partialExpand() }
|
||||
true
|
||||
}
|
||||
}
|
||||
if (!state.skipHiddenState) {
|
||||
@@ -314,7 +316,6 @@ private fun CustomStandardBottomSheet(
|
||||
*/
|
||||
@ExperimentalFoundationApi
|
||||
class DraggableAnchorsConfig<T> {
|
||||
|
||||
internal val anchors = mutableMapOf<T, Float>()
|
||||
|
||||
/**
|
||||
@@ -344,7 +345,6 @@ internal fun <T : Any> DraggableAnchors(
|
||||
): DraggableAnchors<T> = MapDraggableAnchors(DraggableAnchorsConfig<T>().apply(builder).anchors)
|
||||
|
||||
private class MapDraggableAnchors<T>(private val anchors: Map<T, Float>) : DraggableAnchors<T> {
|
||||
|
||||
override fun positionOf(value: T): Float = anchors[value] ?: Float.NaN
|
||||
override fun hasAnchorFor(value: T) = anchors.containsKey(value)
|
||||
|
||||
|
||||
@@ -51,7 +51,6 @@ constructor(
|
||||
confirmValueChange: (SheetValue) -> Boolean = { true },
|
||||
internal val skipHiddenState: Boolean = false,
|
||||
) {
|
||||
|
||||
/**
|
||||
* State of a sheet composable, such as [ModalBottomSheet]
|
||||
*
|
||||
|
||||
@@ -30,7 +30,8 @@ import io.element.android.libraries.designsystem.theme.components.Snackbar
|
||||
fun SnackbarHost(hostState: SnackbarHostState, modifier: Modifier = Modifier) {
|
||||
androidx.compose.material3.SnackbarHost(hostState, modifier) { data ->
|
||||
Snackbar(
|
||||
modifier = Modifier.padding(12.dp), // Add default padding
|
||||
// Add default padding
|
||||
modifier = Modifier.padding(12.dp),
|
||||
message = data.visuals.message,
|
||||
action = data.visuals.actionLabel?.let { ButtonVisuals.Text(it, data::performAction) },
|
||||
dismissAction = if (data.visuals.withDismissAction) {
|
||||
|
||||
@@ -22,7 +22,6 @@ import io.element.android.compound.theme.avatarColorsLight
|
||||
import org.junit.Test
|
||||
|
||||
class AvatarColorsTest {
|
||||
|
||||
@Test
|
||||
fun `ensure the size of the avatar color are equal for light and dark theme`() {
|
||||
assertThat(avatarColorsDark.size).isEqualTo(avatarColorsLight.size)
|
||||
|
||||
@@ -22,7 +22,6 @@ import kotlinx.coroutines.test.runTest
|
||||
import org.junit.Test
|
||||
|
||||
class SnackbarDispatcherTests {
|
||||
|
||||
@Test
|
||||
fun `given an empty queue the flow emits a null item`() = runTest {
|
||||
val snackbarDispatcher = SnackbarDispatcher()
|
||||
|
||||
@@ -33,7 +33,6 @@ class RandomSecretPassphraseProvider(
|
||||
private val file: File,
|
||||
private val secretSize: Int = 256,
|
||||
) : PassphraseProvider {
|
||||
|
||||
override fun getPassphrase(): ByteArray {
|
||||
val encryptedFile = EncryptedFileFactory(context).create(file)
|
||||
return if (!file.exists()) {
|
||||
|
||||
@@ -36,7 +36,6 @@ internal class MapApplier(
|
||||
val style: Style,
|
||||
val symbolManager: SymbolManager,
|
||||
) : AbstractApplier<MapNode>(MapNodeRoot) {
|
||||
|
||||
private val decorations = mutableListOf<MapNode>()
|
||||
|
||||
override fun onClear() {
|
||||
|
||||
@@ -42,7 +42,6 @@ internal class MapPropertiesNode(
|
||||
cameraPositionState: CameraPositionState,
|
||||
locationSettings: MapLocationSettings,
|
||||
) : MapNode {
|
||||
|
||||
init {
|
||||
map.locationComponent.activateLocationComponent(
|
||||
LocationComponentActivationOptions.Builder(context, style)
|
||||
|
||||
@@ -34,7 +34,7 @@ object MatrixToConverter {
|
||||
*/
|
||||
fun convert(uri: Uri): Uri? {
|
||||
val uriString = uri.toString()
|
||||
val baseUrl = MatrixConfiguration.matrixToPermalinkBaseUrl
|
||||
val baseUrl = MatrixConfiguration.MATRIX_TO_PERMALINK_BASE_URL
|
||||
|
||||
return when {
|
||||
// URL is already a matrix.to
|
||||
|
||||
@@ -26,7 +26,7 @@ object PermalinkBuilder {
|
||||
private const val ROOM_PATH = "room/"
|
||||
private const val USER_PATH = "user/"
|
||||
|
||||
private val permalinkBaseUrl get() = (MatrixConfiguration.clientPermalinkBaseUrl ?: MatrixConfiguration.matrixToPermalinkBaseUrl).also {
|
||||
private val permalinkBaseUrl get() = (MatrixConfiguration.clientPermalinkBaseUrl ?: MatrixConfiguration.MATRIX_TO_PERMALINK_BASE_URL).also {
|
||||
var baseUrl = it
|
||||
if (!baseUrl.endsWith("/")) {
|
||||
baseUrl += "/"
|
||||
@@ -80,7 +80,7 @@ object PermalinkBuilder {
|
||||
|
||||
private fun escapeId(value: String) = value.replace("/", "%2F")
|
||||
|
||||
private fun isMatrixTo(): Boolean = permalinkBaseUrl.startsWith(MatrixConfiguration.matrixToPermalinkBaseUrl)
|
||||
private fun isMatrixTo(): Boolean = permalinkBaseUrl.startsWith(MatrixConfiguration.MATRIX_TO_PERMALINK_BASE_URL)
|
||||
}
|
||||
|
||||
sealed class PermalinkBuilderError : Throwable() {
|
||||
|
||||
@@ -136,7 +136,13 @@ fun AttachmentThumbnail(
|
||||
|
||||
@Parcelize
|
||||
enum class AttachmentThumbnailType : Parcelable {
|
||||
Image, Video, File, Audio, Location, Voice, Poll
|
||||
Image,
|
||||
Video,
|
||||
File,
|
||||
Audio,
|
||||
Location,
|
||||
Voice,
|
||||
Poll,
|
||||
}
|
||||
|
||||
@Parcelize
|
||||
|
||||
@@ -41,7 +41,6 @@ internal class CoilMediaFetcher(
|
||||
private val mediaData: MediaRequestData?,
|
||||
private val options: Options
|
||||
) : Fetcher {
|
||||
|
||||
override suspend fun fetch(): FetchResult? {
|
||||
if (mediaData?.source == null) return null
|
||||
return when (mediaData.kind) {
|
||||
@@ -126,9 +125,7 @@ internal class CoilMediaFetcher(
|
||||
class AvatarFactory(
|
||||
private val context: Context,
|
||||
private val client: MatrixClient
|
||||
) :
|
||||
Fetcher.Factory<AvatarData> {
|
||||
|
||||
) : Fetcher.Factory<AvatarData> {
|
||||
override fun create(
|
||||
data: AvatarData,
|
||||
options: Options,
|
||||
|
||||
@@ -33,7 +33,6 @@ data class MediaRequestData(
|
||||
val source: MediaSource?,
|
||||
val kind: Kind
|
||||
) {
|
||||
|
||||
sealed interface Kind {
|
||||
data object Content : Kind
|
||||
data class File(val body: String?, val mimeType: String) : Kind
|
||||
|
||||
@@ -26,7 +26,6 @@ import org.robolectric.RobolectricTestRunner
|
||||
|
||||
@RunWith(RobolectricTestRunner::class)
|
||||
class ToHtmlDocumentTest {
|
||||
|
||||
@Test
|
||||
fun `toHtmlDocument - returns null if format is not HTML`() {
|
||||
val body = FormattedBody(
|
||||
|
||||
@@ -28,7 +28,6 @@ import org.robolectric.RobolectricTestRunner
|
||||
|
||||
@RunWith(RobolectricTestRunner::class)
|
||||
class ToPlainTextTest {
|
||||
|
||||
@Test
|
||||
fun `Document toPlainText - returns a plain text version of the document`() {
|
||||
val document = Jsoup.parse(
|
||||
|
||||
@@ -25,7 +25,6 @@ import timber.log.Timber
|
||||
internal class FormattedJsonHttpLogger(
|
||||
private val level: HttpLoggingInterceptor.Level
|
||||
) : HttpLoggingInterceptor.Logger {
|
||||
|
||||
companion object {
|
||||
private const val INDENT_SPACE = 2
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ class PushersManager @Inject constructor(
|
||||
pushGatewayNotifyRequest.execute(
|
||||
PushGatewayNotifyRequest.Params(
|
||||
url = "TODO", // unifiedPushHelper.getPushGateway() ?: return,
|
||||
appId = PushConfig.pusher_app_id,
|
||||
appId = PushConfig.PUSHER_APP_ID,
|
||||
pushKey = "TODO", // unifiedPushHelper.getEndpointOrToken().orEmpty(),
|
||||
eventId = TEST_EVENT_ID
|
||||
)
|
||||
@@ -85,7 +85,7 @@ class PushersManager @Inject constructor(
|
||||
): SetHttpPusherData =
|
||||
SetHttpPusherData(
|
||||
pushKey = pushKey,
|
||||
appId = PushConfig.pusher_app_id,
|
||||
appId = PushConfig.PUSHER_APP_ID,
|
||||
profileTag = DEFAULT_PUSHER_FILE_TAG + "_" /* TODO + abs(activeSessionHolder.getActiveSession().myUserId.hashCode())*/,
|
||||
lang = "en", // TODO localeProvider.current().language,
|
||||
appDisplayName = buildMeta.applicationName,
|
||||
|
||||
@@ -38,7 +38,7 @@ class MarkAsReadActionFactory @Inject constructor(
|
||||
private val clock: SystemClock,
|
||||
) {
|
||||
fun create(roomInfo: RoomEventGroupInfo): NotificationCompat.Action? {
|
||||
if (!NotificationConfig.supportMarkAsReadAction) return null
|
||||
if (!NotificationConfig.SUPPORT_MARK_AS_READ_ACTION) return null
|
||||
val sessionId = roomInfo.sessionId.value
|
||||
val roomId = roomInfo.roomId.value
|
||||
val intent = Intent(context, NotificationBroadcastReceiver::class.java)
|
||||
|
||||
@@ -43,7 +43,7 @@ class QuickReplyActionFactory @Inject constructor(
|
||||
private val clock: SystemClock,
|
||||
) {
|
||||
fun create(roomInfo: RoomEventGroupInfo, threadId: ThreadId?): NotificationCompat.Action? {
|
||||
if (!NotificationConfig.supportQuickReplyAction) return null
|
||||
if (!NotificationConfig.SUPPORT_QUICK_REPLY_ACTION) return null
|
||||
val sessionId = roomInfo.sessionId
|
||||
val roomId = roomInfo.roomId
|
||||
return buildQuickReplyIntent(sessionId, roomId, threadId)?.let { replyPendingIntent ->
|
||||
|
||||
Reference in New Issue
Block a user