Big annoying commit: execute command ./gradlew ktlintFormat - Fix "colon-spacing"

This commit is contained in:
Benoit Marty 2021-10-01 13:27:53 +02:00 committed by Benoit Marty
parent a1caccbcc8
commit d1e9f3131a
223 changed files with 416 additions and 432 deletions

View file

@ -290,8 +290,8 @@ abstract class AttachmentViewerActivity : AppCompatActivity(), AttachmentEventLi
private fun calculateTranslationAlpha(translationY: Float, translationLimit: Int): Float =
1.0f - 1.0f / translationLimit.toFloat() / 4f * abs(translationY)
private fun createSwipeToDismissHandler()
: SwipeToDismissHandler = SwipeToDismissHandler(
private fun createSwipeToDismissHandler(): SwipeToDismissHandler =
SwipeToDismissHandler(
swipeView = views.dismissContainer,
shouldAnimateDismiss = { shouldAnimateDismiss() },
onDismiss = { animateClose() },

View file

@ -36,8 +36,8 @@ interface ImageLoaderTarget {
fun onResourceReady(uid: String, resource: Drawable)
}
internal class DefaultImageLoaderTarget(val holder: AnimatedImageViewHolder, private val contextView: ImageView)
: ImageLoaderTarget {
internal class DefaultImageLoaderTarget(val holder: AnimatedImageViewHolder, private val contextView: ImageView) :
ImageLoaderTarget {
override fun contextView(): ImageView {
return contextView
}

View file

@ -34,8 +34,8 @@ private class LiveDataObservable<T>(
liveData.observeForever(relay)
}
private inner class RemoveObserverInMainThread(private val observer: io.reactivex.Observer<in T>)
: MainThreadDisposable(), Observer<T> {
private inner class RemoveObserverInMainThread(private val observer: io.reactivex.Observer<in T>) :
MainThreadDisposable(), Observer<T> {
override fun onChanged(t: T?) {
if (!isDisposed) {

View file

@ -551,7 +551,7 @@ class SASTest : InstrumentedTest {
cryptoTestData.roomId
)
var requestID : String? = null
var requestID: String? = null
mTestHelper.waitWithLatch {
mTestHelper.retryPeriodicallyWithLatch(it) {

View file

@ -36,8 +36,8 @@ import javax.inject.Inject
* non-production environment.
*/
@MatrixScope
internal class CurlLoggingInterceptor @Inject constructor()
: Interceptor {
internal class CurlLoggingInterceptor @Inject constructor() :
Interceptor {
/**
* Set any additional curl command options (see 'curl --help').

View file

@ -27,5 +27,5 @@ interface UIABaseAuth {
fun copyWithSession(session: String): UIABaseAuth
fun asMap() : Map<String, *>
fun asMap(): Map<String, *>
}

View file

@ -26,7 +26,7 @@ sealed class CallState {
/**
* CreateOffer. Intermediate state between Idle and Dialing.
*/
object CreateOffer: CallState()
object CreateOffer : CallState()
/** Dialing. Outgoing call is signaling the remote peer */
object Dialing : CallState()

View file

@ -89,7 +89,7 @@ data class HomeServerCapabilities(
* You can also use #isFeatureSupported prior to this call to check if the
* feature is supported and report some feedback to user.
*/
fun versionOverrideForFeature(feature: String) : String? {
fun versionOverrideForFeature(feature: String): String? {
val cap = roomVersions?.capabilities?.get(feature)
return cap?.preferred ?: cap?.support?.lastOrNull()
}

View file

@ -132,7 +132,7 @@ interface IdentityService {
* the identity server offers some crypto functionality to help in accepting invitations.
* This is less secure than the client doing it itself, but may be useful where this isn't possible.
*/
suspend fun sign3pidInvitation(identiyServer: String, token: String, secret: String) : SignInvitationResult
suspend fun sign3pidInvitation(identiyServer: String, token: String, secret: String): SignInvitationResult
fun addListener(listener: IdentityServiceListener)

View file

@ -25,7 +25,7 @@ interface SyncStatusService {
/**
* For initial sync
*/
abstract class InitialSyncStatus: Status()
abstract class InitialSyncStatus : Status()
object Idle : InitialSyncStatus()
data class Progressing(
@ -36,7 +36,7 @@ interface SyncStatusService {
/**
* For incremental sync
*/
abstract class IncrementalSyncStatus: Status()
abstract class IncrementalSyncStatus : Status()
object IncrementalSyncIdle : IncrementalSyncStatus()
data class IncrementalSyncParsing(

View file

@ -19,6 +19,6 @@ package org.matrix.android.sdk.api.session.room
import org.matrix.android.sdk.api.session.room.alias.RoomAliasError
sealed class AliasAvailabilityResult {
object Available: AliasAvailabilityResult()
object Available : AliasAvailabilityResult()
data class NotAvailable(val roomAliasError: RoomAliasError) : AliasAvailabilityResult()
}

View file

@ -41,5 +41,5 @@ interface RoomDirectoryService {
*/
suspend fun setRoomDirectoryVisibility(roomId: String, roomDirectoryVisibility: RoomDirectoryVisibility)
suspend fun checkAliasAvailability(aliasLocalPart: String?) : AliasAvailabilityResult
suspend fun checkAliasAvailability(aliasLocalPart: String?): AliasAvailabilityResult
}

View file

@ -220,7 +220,7 @@ interface RoomService {
.setPrefetchDistance(10)
.build()
fun getFlattenRoomSummaryChildrenOf(spaceId: String?, memberships: List<Membership> = Membership.activeMemberships()) : List<RoomSummary>
fun getFlattenRoomSummaryChildrenOf(spaceId: String?, memberships: List<Membership> = Membership.activeMemberships()): List<RoomSummary>
/**
* Returns all the children of this space, as LiveData

View file

@ -44,7 +44,7 @@ data class CallAnswerContent(
* Capability advertisement.
*/
@Json(name = "capabilities") val capabilities: CallCapabilities? = null
): CallSignalingContent {
) : CallSignalingContent {
@JsonClass(generateAdapter = true)
data class Answer(

View file

@ -41,4 +41,4 @@ data class CallCandidatesContent(
* Required. The version of the VoIP specification this messages adheres to.
*/
@Json(name = "version") override val version: String?
): CallSignalingContent
) : CallSignalingContent

View file

@ -55,7 +55,7 @@ data class CallInviteContent(
*/
@Json(name = "capabilities") val capabilities: CallCapabilities? = null
): CallSignalingContent {
) : CallSignalingContent {
@JsonClass(generateAdapter = true)
data class Offer(
/**

View file

@ -47,7 +47,7 @@ data class CallNegotiateContent(
*/
@Json(name = "version") override val version: String?
): CallSignalingContent {
) : CallSignalingContent {
@JsonClass(generateAdapter = true)
data class Description(
/**

View file

@ -61,7 +61,7 @@ data class CallReplacesContent(
* Required. The version of the VoIP specification this messages adheres to.
*/
@Json(name = "version") override val version: String?
): CallSignalingContent {
) : CallSignalingContent {
@JsonClass(generateAdapter = true)
data class TargetUser(

View file

@ -41,4 +41,4 @@ data class CallSelectAnswerContent(
* Required. The version of the VoIP specification this message adheres to.
*/
@Json(name = "version") override val version: String?
): CallSignalingContent
) : CallSignalingContent

View file

@ -31,7 +31,7 @@ interface RoomVersionService {
/**
* Get the recommended room version for the current homeserver
*/
fun getRecommendedVersion() : String
fun getRecommendedVersion(): String
/**
* Ask if the user has enough power level to upgrade the room

View file

@ -22,8 +22,8 @@ sealed class SharedSecretStorageError(message: String?) : Throwable(message) {
data class UnknownAlgorithm(val keyId: String) : SharedSecretStorageError("Unknown algorithm $keyId")
data class UnsupportedAlgorithm(val algorithm: String) : SharedSecretStorageError("Unknown algorithm $algorithm")
data class SecretNotEncrypted(val secretName: String) : SharedSecretStorageError("Missing content for secret $secretName")
data class SecretNotEncryptedWithKey(val secretName: String, val keyId: String)
: SharedSecretStorageError("Missing content for secret $secretName with key $keyId")
data class SecretNotEncryptedWithKey(val secretName: String, val keyId: String) :
SharedSecretStorageError("Missing content for secret $secretName with key $keyId")
object BadKeyFormat : SharedSecretStorageError("Bad Key Format")
object ParsingError : SharedSecretStorageError("parsing Error")

View file

@ -34,8 +34,8 @@ sealed class MatrixItem(
) {
data class UserItem(override val id: String,
override val displayName: String? = null,
override val avatarUrl: String? = null)
: MatrixItem(id, displayName?.removeSuffix(ircPattern), avatarUrl) {
override val avatarUrl: String? = null) :
MatrixItem(id, displayName?.removeSuffix(ircPattern), avatarUrl) {
init {
if (BuildConfig.DEBUG) checkId()
}
@ -45,8 +45,8 @@ sealed class MatrixItem(
data class EventItem(override val id: String,
override val displayName: String? = null,
override val avatarUrl: String? = null)
: MatrixItem(id, displayName, avatarUrl) {
override val avatarUrl: String? = null) :
MatrixItem(id, displayName, avatarUrl) {
init {
if (BuildConfig.DEBUG) checkId()
}
@ -56,8 +56,8 @@ sealed class MatrixItem(
data class RoomItem(override val id: String,
override val displayName: String? = null,
override val avatarUrl: String? = null)
: MatrixItem(id, displayName, avatarUrl) {
override val avatarUrl: String? = null) :
MatrixItem(id, displayName, avatarUrl) {
init {
if (BuildConfig.DEBUG) checkId()
}
@ -67,8 +67,8 @@ sealed class MatrixItem(
data class SpaceItem(override val id: String,
override val displayName: String? = null,
override val avatarUrl: String? = null)
: MatrixItem(id, displayName, avatarUrl) {
override val avatarUrl: String? = null) :
MatrixItem(id, displayName, avatarUrl) {
init {
if (BuildConfig.DEBUG) checkId()
}
@ -78,8 +78,8 @@ sealed class MatrixItem(
data class RoomAliasItem(override val id: String,
override val displayName: String? = null,
override val avatarUrl: String? = null)
: MatrixItem(id, displayName, avatarUrl) {
override val avatarUrl: String? = null) :
MatrixItem(id, displayName, avatarUrl) {
init {
if (BuildConfig.DEBUG) checkId()
}
@ -92,8 +92,8 @@ sealed class MatrixItem(
data class GroupItem(override val id: String,
override val displayName: String? = null,
override val avatarUrl: String? = null)
: MatrixItem(id, displayName, avatarUrl) {
override val avatarUrl: String? = null) :
MatrixItem(id, displayName, avatarUrl) {
init {
if (BuildConfig.DEBUG) checkId()
}

View file

@ -35,8 +35,8 @@ import org.matrix.android.sdk.internal.worker.SessionWorkerParams
import javax.inject.Inject
internal class CancelGossipRequestWorker(context: Context,
params: WorkerParameters)
: SessionSafeCoroutineWorker<CancelGossipRequestWorker.Params>(context, params, Params::class.java) {
params: WorkerParameters) :
SessionSafeCoroutineWorker<CancelGossipRequestWorker.Params>(context, params, Params::class.java) {
@JsonClass(generateAdapter = true)
internal data class Params(

View file

@ -38,8 +38,8 @@ import timber.log.Timber
import javax.inject.Inject
internal class SendGossipRequestWorker(context: Context,
params: WorkerParameters)
: SessionSafeCoroutineWorker<SendGossipRequestWorker.Params>(context, params, Params::class.java) {
params: WorkerParameters) :
SessionSafeCoroutineWorker<SendGossipRequestWorker.Params>(context, params, Params::class.java) {
@JsonClass(generateAdapter = true)
internal data class Params(

View file

@ -38,8 +38,8 @@ import timber.log.Timber
import javax.inject.Inject
internal class SendGossipWorker(context: Context,
params: WorkerParameters)
: SessionSafeCoroutineWorker<SendGossipWorker.Params>(context, params, Params::class.java) {
params: WorkerParameters) :
SessionSafeCoroutineWorker<SendGossipWorker.Params>(context, params, Params::class.java) {
@JsonClass(generateAdapter = true)
internal data class Params(

View file

@ -34,8 +34,8 @@ internal class MXOlmDecryption(
// The olm device interface
private val olmDevice: MXOlmDevice,
// the matrix userId
private val userId: String)
: IMXDecrypting {
private val userId: String) :
IMXDecrypting {
@Throws(MXCryptoError::class)
override fun decryptEvent(event: Event, timeline: String): MXEventDecryptionResult {

View file

@ -32,8 +32,8 @@ internal class MXOlmEncryption(
private val cryptoStore: IMXCryptoStore,
private val messageEncrypter: MessageEncrypter,
private val deviceListManager: DeviceListManager,
private val ensureOlmSessionsForUsersAction: EnsureOlmSessionsForUsersAction)
: IMXEncrypting {
private val ensureOlmSessionsForUsersAction: EnsureOlmSessionsForUsersAction) :
IMXEncrypting {
override suspend fun encryptEventContent(eventContent: Content, eventType: String, userIds: List<String>): Content {
// pick the list of recipients based on the membership list.

View file

@ -51,8 +51,8 @@ import timber.log.Timber
import javax.inject.Inject
internal class UpdateTrustWorker(context: Context,
params: WorkerParameters)
: SessionSafeCoroutineWorker<UpdateTrustWorker.Params>(context, params, Params::class.java) {
params: WorkerParameters) :
SessionSafeCoroutineWorker<UpdateTrustWorker.Params>(context, params, Params::class.java) {
@JsonClass(generateAdapter = true)
internal data class Params(

View file

@ -28,8 +28,8 @@ internal open class CryptoRoomEntity(
// to avoid re-create and re-share at each startup (if rotation not needed..)
// This is specific to megolm but not sure how to model it better
var outboundSessionInfo: OutboundGroupSessionInfoEntity? = null
)
: RealmObject() {
) :
RealmObject() {
companion object
}

View file

@ -33,8 +33,8 @@ internal open class OlmInboundGroupSessionEntity(
// olmInboundGroupSessionData contains Json
var olmInboundGroupSessionData: String? = null,
// Indicate if the key has been backed up to the homeserver
var backedUp: Boolean = false)
: RealmObject() {
var backedUp: Boolean = false) :
RealmObject() {
fun getInboundGroupSession(): OlmInboundGroupSessionWrapper2? {
return try {

View file

@ -29,8 +29,8 @@ internal open class OlmSessionEntity(@PrimaryKey var primaryKey: String = "",
var sessionId: String? = null,
var deviceKey: String? = null,
var olmSessionData: String? = null,
var lastReceivedMessageTs: Long = 0)
: RealmObject() {
var lastReceivedMessageTs: Long = 0) :
RealmObject() {
fun getOlmSession(): OlmSession? {
return deserializeFromRealm(olmSessionData)

View file

@ -29,8 +29,7 @@ internal fun SharedSessionEntity.Companion.get(realm: Realm,
sessionId: String,
userId: String,
deviceId: String,
deviceIdentityKey: String?)
: SharedSessionEntity? {
deviceIdentityKey: String?): SharedSessionEntity? {
return realm.where<SharedSessionEntity>()
.equalTo(SharedSessionEntityFields.ROOM_ID, roomId)
.equalTo(SharedSessionEntityFields.SESSION_ID, sessionId)
@ -41,8 +40,7 @@ internal fun SharedSessionEntity.Companion.get(realm: Realm,
.findFirst()
}
internal fun SharedSessionEntity.Companion.get(realm: Realm, roomId: String?, sessionId: String)
: RealmResults<SharedSessionEntity> {
internal fun SharedSessionEntity.Companion.get(realm: Realm, roomId: String?, sessionId: String): RealmResults<SharedSessionEntity> {
return realm.where<SharedSessionEntity>()
.equalTo(SharedSessionEntityFields.ROOM_ID, roomId)
.equalTo(SharedSessionEntityFields.SESSION_ID, sessionId)
@ -55,8 +53,7 @@ internal fun SharedSessionEntity.Companion.create(realm: Realm, roomId: String?,
userId: String,
deviceId: String,
deviceIdentityKey: String,
chainIndex: Int)
: SharedSessionEntity {
chainIndex: Int): SharedSessionEntity {
return realm.createObject<SharedSessionEntity>().apply {
this.roomId = roomId
this.algorithm = MXCRYPTO_ALGORITHM_MEGOLM

View file

@ -1126,8 +1126,7 @@ internal class DefaultVerificationService @Inject constructor(
}
}
override fun requestKeyVerificationInDMs(methods: List<VerificationMethod>, otherUserId: String, roomId: String, localId: String?)
: PendingVerificationRequest {
override fun requestKeyVerificationInDMs(methods: List<VerificationMethod>, otherUserId: String, roomId: String, localId: String?): PendingVerificationRequest {
Timber.i("## SAS Requesting verification to user: $otherUserId in room $roomId")
val requestsForUser = pendingRequests.getOrPut(otherUserId) { mutableListOf() }

View file

@ -34,8 +34,8 @@ import javax.inject.Inject
* Possible next worker : None
*/
internal class SendVerificationMessageWorker(context: Context,
params: WorkerParameters)
: SessionSafeCoroutineWorker<SendVerificationMessageWorker.Params>(context, params, Params::class.java) {
params: WorkerParameters) :
SessionSafeCoroutineWorker<SendVerificationMessageWorker.Params>(context, params, Params::class.java) {
@JsonClass(generateAdapter = true)
internal data class Params(

View file

@ -294,8 +294,8 @@ internal class VerificationTransportRoomMessage(
hash: String,
commitment: String,
messageAuthenticationCode: String,
shortAuthenticationStrings: List<String>)
: VerificationInfoAccept = MessageVerificationAcceptContent.create(
shortAuthenticationStrings: List<String>): VerificationInfoAccept =
MessageVerificationAcceptContent.create(
tid,
keyAgreementProtocol,
hash,

View file

@ -31,8 +31,8 @@ import timber.log.Timber
import javax.inject.Inject
internal class EventInsertLiveObserver @Inject constructor(@SessionDatabase realmConfiguration: RealmConfiguration,
private val processors: Set<@JvmSuppressWildcards EventInsertLiveProcessor>)
: RealmLiveEntityObserver<EventInsertEntity>(realmConfiguration) {
private val processors: Set<@JvmSuppressWildcards EventInsertLiveProcessor>) :
RealmLiveEntityObserver<EventInsertEntity>(realmConfiguration) {
override val query = Monarchy.Query {
it.where(EventInsertEntity::class.java).equalTo(EventInsertEntityFields.CAN_BE_PROCESSED, true)

View file

@ -34,8 +34,8 @@ import java.util.concurrent.atomic.AtomicReference
internal interface LiveEntityObserver : SessionLifecycleObserver
internal abstract class RealmLiveEntityObserver<T : RealmObject>(protected val realmConfiguration: RealmConfiguration)
: LiveEntityObserver, RealmChangeListener<RealmResults<T>> {
internal abstract class RealmLiveEntityObserver<T : RealmObject>(protected val realmConfiguration: RealmConfiguration) :
LiveEntityObserver, RealmChangeListener<RealmResults<T>> {
private companion object {
val BACKGROUND_HANDLER = createBackgroundHandler("LIVE_ENTITY_BACKGROUND")

View file

@ -32,8 +32,8 @@ import kotlin.concurrent.getOrSet
* instance. This does check each time if you are on the main thread or not and returns the appropriate realm instance.
*/
@SessionScope
internal class RealmSessionProvider @Inject constructor(@SessionDatabase private val monarchy: Monarchy)
: SessionLifecycleObserver {
internal class RealmSessionProvider @Inject constructor(@SessionDatabase private val monarchy: Monarchy) :
SessionLifecycleObserver {
private val realmThreadLocal = ThreadLocal<Realm>()

View file

@ -24,8 +24,8 @@ import org.matrix.android.sdk.api.session.room.model.Membership
* This class is used to store group info (groupId and membership) from the sync response.
* Then GetGroupDataTask is called regularly to fetch group information from the homeserver.
*/
internal open class GroupEntity(@PrimaryKey var groupId: String = "")
: RealmObject() {
internal open class GroupEntity(@PrimaryKey var groupId: String = "") :
RealmObject() {
private var membershipStr: String = Membership.NONE.name
var membership: Membership

View file

@ -29,8 +29,7 @@ internal fun CurrentStateEventEntity.Companion.whereType(realm: Realm, roomId: S
.equalTo(CurrentStateEventEntityFields.TYPE, type)
}
internal fun CurrentStateEventEntity.Companion.whereStateKey(realm: Realm, roomId: String, type: String, stateKey: String)
: RealmQuery<CurrentStateEventEntity> {
internal fun CurrentStateEventEntity.Companion.whereStateKey(realm: Realm, roomId: String, type: String, stateKey: String): RealmQuery<CurrentStateEventEntity> {
return whereType(realm = realm, roomId = roomId, type = type)
.equalTo(CurrentStateEventEntityFields.STATE_KEY, stateKey)
}

View file

@ -119,8 +119,7 @@ internal fun RealmList<TimelineEventEntity>.find(eventId: String): TimelineEvent
internal fun TimelineEventEntity.Companion.findAllInRoomWithSendStates(realm: Realm,
roomId: String,
sendStates: List<SendState>)
: RealmResults<TimelineEventEntity> {
sendStates: List<SendState>): RealmResults<TimelineEventEntity> {
return whereRoomId(realm, roomId)
.filterSendStates(sendStates)
.findAll()

View file

@ -43,8 +43,8 @@ interface NetworkConnectivityChecker {
@SessionScope
internal class DefaultNetworkConnectivityChecker @Inject constructor(private val homeServerPinger: HomeServerPinger,
private val backgroundDetectionObserver: BackgroundDetectionObserver,
private val networkCallbackStrategy: NetworkCallbackStrategy)
: NetworkConnectivityChecker {
private val networkCallbackStrategy: NetworkCallbackStrategy) :
NetworkConnectivityChecker {
private val hasInternetAccess = AtomicBoolean(true)
private val listeners = Collections.synchronizedSet(LinkedHashSet<NetworkConnectivityChecker.Listener>())

View file

@ -25,7 +25,7 @@ import org.matrix.android.sdk.api.session.SessionLifecycleObserver
import javax.inject.Inject
@SessionScope
internal class SessionCoroutineScopeHolder @Inject constructor(): SessionLifecycleObserver {
internal class SessionCoroutineScopeHolder @Inject constructor() : SessionLifecycleObserver {
val scope: CoroutineScope = CoroutineScope(SupervisorJob())

View file

@ -29,8 +29,8 @@ import javax.inject.Inject
private val loggerTag = LoggerTag("CallEventProcessor", LoggerTag.VOIP)
@SessionScope
internal class CallEventProcessor @Inject constructor(private val callSignalingHandler: CallSignalingHandler)
: EventInsertLiveProcessor {
internal class CallEventProcessor @Inject constructor(private val callSignalingHandler: CallSignalingHandler) :
EventInsertLiveProcessor {
private val allowedTypes = listOf(
EventType.CALL_ANSWER,

View file

@ -63,8 +63,8 @@ private data class NewAttachmentAttributes(
* Possible previous worker: None
* Possible next worker : Always [MultipleEventSendingDispatcherWorker]
*/
internal class UploadContentWorker(val context: Context, params: WorkerParameters)
: SessionSafeCoroutineWorker<UploadContentWorker.Params>(context, params, Params::class.java) {
internal class UploadContentWorker(val context: Context, params: WorkerParameters) :
SessionSafeCoroutineWorker<UploadContentWorker.Params>(context, params, Params::class.java) {
@JsonClass(generateAdapter = true)
internal data class Params(

View file

@ -28,8 +28,8 @@ import javax.inject.Inject
* Possible previous worker: None
* Possible next worker : None
*/
internal class GetGroupDataWorker(context: Context, params: WorkerParameters)
: SessionSafeCoroutineWorker<GetGroupDataWorker.Params>(context, params, Params::class.java) {
internal class GetGroupDataWorker(context: Context, params: WorkerParameters) :
SessionSafeCoroutineWorker<GetGroupDataWorker.Params>(context, params, Params::class.java) {
@JsonClass(generateAdapter = true)
internal data class Params(

View file

@ -23,8 +23,8 @@ import org.matrix.android.sdk.internal.session.SessionScope
import javax.inject.Inject
@SessionScope
internal class DefaultSyncStatusService @Inject constructor()
: SyncStatusService,
internal class DefaultSyncStatusService @Inject constructor() :
SyncStatusService,
ProgressReporter {
private val status = MutableLiveData<SyncStatusService.Status>()

View file

@ -58,8 +58,8 @@ internal class IntegrationManager @Inject constructor(matrixConfiguration: Matri
@SessionDatabase private val monarchy: Monarchy,
private val updateUserAccountDataTask: UpdateUserAccountDataTask,
private val accountDataDataSource: UserAccountDataDataSource,
private val widgetFactory: WidgetFactory)
: SessionLifecycleObserver {
private val widgetFactory: WidgetFactory) :
SessionLifecycleObserver {
private val currentConfigs = ArrayList<IntegrationManagerConfig>()
private val lifecycleOwner: LifecycleOwner = LifecycleOwner { lifecycleRegistry }

View file

@ -20,7 +20,7 @@ import org.matrix.android.sdk.api.session.openid.OpenIdService
import org.matrix.android.sdk.api.session.openid.OpenIdToken
import javax.inject.Inject
internal class DefaultOpenIdService @Inject constructor(private val getOpenIdTokenTask: GetOpenIdTokenTask): OpenIdService {
internal class DefaultOpenIdService @Inject constructor(private val getOpenIdTokenTask: GetOpenIdTokenTask) : OpenIdService {
override suspend fun getOpenIdToken(): OpenIdToken {
return getOpenIdTokenTask.execute(Unit)

View file

@ -33,8 +33,8 @@ import org.matrix.android.sdk.internal.worker.SessionSafeCoroutineWorker
import org.matrix.android.sdk.internal.worker.SessionWorkerParams
import javax.inject.Inject
internal class AddPusherWorker(context: Context, params: WorkerParameters)
: SessionSafeCoroutineWorker<AddPusherWorker.Params>(context, params, Params::class.java) {
internal class AddPusherWorker(context: Context, params: WorkerParameters) :
SessionSafeCoroutineWorker<AddPusherWorker.Params>(context, params, Params::class.java) {
@JsonClass(generateAdapter = true)
internal data class Params(

View file

@ -93,13 +93,11 @@ internal class DefaultRoomService @Inject constructor(
return roomSummaryDataSource.getRoomSummariesLive(queryParams)
}
override fun getPagedRoomSummariesLive(queryParams: RoomSummaryQueryParams, pagedListConfig: PagedList.Config, sortOrder: RoomSortOrder)
: LiveData<PagedList<RoomSummary>> {
override fun getPagedRoomSummariesLive(queryParams: RoomSummaryQueryParams, pagedListConfig: PagedList.Config, sortOrder: RoomSortOrder): LiveData<PagedList<RoomSummary>> {
return roomSummaryDataSource.getSortedPagedRoomSummariesLive(queryParams, pagedListConfig, sortOrder)
}
override fun getFilteredPagedRoomSummariesLive(queryParams: RoomSummaryQueryParams, pagedListConfig: PagedList.Config, sortOrder: RoomSortOrder)
: UpdatableLivePageResult {
override fun getFilteredPagedRoomSummariesLive(queryParams: RoomSummaryQueryParams, pagedListConfig: PagedList.Config, sortOrder: RoomSortOrder): UpdatableLivePageResult {
return roomSummaryDataSource.getUpdatablePagedRoomSummariesLive(queryParams, pagedListConfig, sortOrder)
}

View file

@ -43,7 +43,7 @@ internal interface JoinRoomTask : Task<JoinRoomTask.Params, Unit> {
val roomIdOrAlias: String,
val reason: String?,
val viaServers: List<String> = emptyList(),
val thirdPartySigned : SignInvitationResult? = null
val thirdPartySigned: SignInvitationResult? = null
)
}

View file

@ -31,8 +31,8 @@ import org.matrix.android.sdk.internal.di.SessionDatabase
internal class DefaultRoomPushRuleService @AssistedInject constructor(@Assisted private val roomId: String,
private val setRoomNotificationStateTask: SetRoomNotificationStateTask,
@SessionDatabase private val monarchy: Monarchy)
: RoomPushRuleService {
@SessionDatabase private val monarchy: Monarchy) :
RoomPushRuleService {
@AssistedFactory
interface Factory {

View file

@ -37,8 +37,8 @@ internal interface SetRoomNotificationStateTask : Task<SetRoomNotificationStateT
internal class DefaultSetRoomNotificationStateTask @Inject constructor(@SessionDatabase private val monarchy: Monarchy,
private val removePushRuleTask: RemovePushRuleTask,
private val addPushRuleTask: AddPushRuleTask)
: SetRoomNotificationStateTask {
private val addPushRuleTask: AddPushRuleTask) :
SetRoomNotificationStateTask {
override suspend fun execute(params: SetRoomNotificationStateTask.Params) {
val currentRoomPushRule = Realm.getInstance(monarchy.realmConfiguration).use {

View file

@ -54,8 +54,8 @@ internal class DefaultRelationService @AssistedInject constructor(
private val fetchEditHistoryTask: FetchEditHistoryTask,
private val timelineEventMapper: TimelineEventMapper,
@SessionDatabase private val monarchy: Monarchy,
private val taskExecutor: TaskExecutor)
: RelationService {
private val taskExecutor: TaskExecutor) :
RelationService {
@AssistedFactory
interface Factory {

View file

@ -33,8 +33,8 @@ import org.matrix.android.sdk.internal.worker.SessionWorkerParams
import javax.inject.Inject
// TODO This is not used. Delete?
internal class SendRelationWorker(context: Context, params: WorkerParameters)
: SessionSafeCoroutineWorker<SendRelationWorker.Params>(context, params, Params::class.java) {
internal class SendRelationWorker(context: Context, params: WorkerParameters) :
SessionSafeCoroutineWorker<SendRelationWorker.Params>(context, params, Params::class.java) {
@JsonClass(generateAdapter = true)
internal data class Params(

View file

@ -38,8 +38,8 @@ import javax.inject.Inject
* Possible previous worker: Always [UploadContentWorker]
* Possible next worker : None, but it will post new work to send events, encrypted or not
*/
internal class MultipleEventSendingDispatcherWorker(context: Context, params: WorkerParameters)
: SessionSafeCoroutineWorker<MultipleEventSendingDispatcherWorker.Params>(context, params, Params::class.java) {
internal class MultipleEventSendingDispatcherWorker(context: Context, params: WorkerParameters) :
SessionSafeCoroutineWorker<MultipleEventSendingDispatcherWorker.Params>(context, params, Params::class.java) {
@JsonClass(generateAdapter = true)
internal data class Params(

View file

@ -32,8 +32,8 @@ import javax.inject.Inject
* Possible previous worker: None
* Possible next worker : None
*/
internal class RedactEventWorker(context: Context, params: WorkerParameters)
: SessionSafeCoroutineWorker<RedactEventWorker.Params>(context, params, Params::class.java) {
internal class RedactEventWorker(context: Context, params: WorkerParameters) :
SessionSafeCoroutineWorker<RedactEventWorker.Params>(context, params, Params::class.java) {
@JsonClass(generateAdapter = true)
internal data class Params(

View file

@ -39,8 +39,8 @@ import javax.inject.Inject
* Possible next worker : None
*/
internal class SendEventWorker(context: Context,
params: WorkerParameters)
: SessionSafeCoroutineWorker<SendEventWorker.Params>(context, params, Params::class.java) {
params: WorkerParameters) :
SessionSafeCoroutineWorker<SendEventWorker.Params>(context, params, Params::class.java) {
@JsonClass(generateAdapter = true)
internal data class Params(

View file

@ -20,7 +20,7 @@ import org.matrix.android.sdk.api.session.SessionLifecycleObserver
import org.matrix.android.sdk.api.session.events.model.Event
import org.matrix.android.sdk.api.util.Cancelable
internal interface EventSenderProcessor: SessionLifecycleObserver {
internal interface EventSenderProcessor : SessionLifecycleObserver {
fun postEvent(event: Event): Cancelable

View file

@ -40,8 +40,8 @@ internal class LiveTimelineEvent(private val monarchy: Monarchy,
private val coroutineScope: CoroutineScope,
private val timelineEventMapper: TimelineEventMapper,
private val roomId: String,
private val eventId: String)
: MediatorLiveData<Optional<TimelineEvent>>() {
private val eventId: String) :
MediatorLiveData<Optional<TimelineEvent>>() {
init {
buildAndObserveQuery()

View file

@ -53,5 +53,5 @@ sealed class SpacePeekResult {
data class FailedToResolve(val spaceId: String, val roomPeekResult: PeekResult) : SpacePeekError()
data class NotSpaceType(val spaceId: String) : SpacePeekError()
data class Success(val summary: SpacePeekSummary): SpacePeekResult()
data class Success(val summary: SpacePeekSummary) : SpacePeekResult()
}

View file

@ -22,8 +22,8 @@ import org.matrix.android.sdk.api.session.thirdparty.model.ThirdPartyUser
import javax.inject.Inject
internal class DefaultThirdPartyService @Inject constructor(private val getThirdPartyProtocolTask: GetThirdPartyProtocolsTask,
private val getThirdPartyUserTask: GetThirdPartyUserTask)
: ThirdPartyService {
private val getThirdPartyUserTask: GetThirdPartyUserTask) :
ThirdPartyService {
override suspend fun getThirdPartyProtocols(): Map<String, ThirdPartyProtocol> {
return getThirdPartyProtocolTask.execute(Unit)

View file

@ -29,8 +29,8 @@ import java.util.HashMap
import javax.inject.Inject
internal class DefaultWidgetPostAPIMediator @Inject constructor(private val moshi: Moshi,
private val widgetPostMessageAPIProvider: WidgetPostMessageAPIProvider)
: WidgetPostAPIMediator {
private val widgetPostMessageAPIProvider: WidgetPostMessageAPIProvider) :
WidgetPostAPIMediator {
private val jsonAdapter = moshi.adapter<JsonDict>(JSON_DICT_PARAMETERIZED_TYPE)

View file

@ -28,8 +28,8 @@ import javax.inject.Provider
internal class DefaultWidgetService @Inject constructor(private val widgetManager: WidgetManager,
private val widgetURLFormatter: WidgetURLFormatter,
private val widgetPostAPIMediator: Provider<WidgetPostAPIMediator>)
: WidgetService {
private val widgetPostAPIMediator: Provider<WidgetPostAPIMediator>) :
WidgetService {
override fun getWidgetURLFormatter(): WidgetURLFormatter {
return widgetURLFormatter

View file

@ -51,9 +51,9 @@ internal class WidgetManager @Inject constructor(private val integrationManager:
private val stateEventDataSource: StateEventDataSource,
private val createWidgetTask: CreateWidgetTask,
private val widgetFactory: WidgetFactory,
@UserId private val userId: String)
@UserId private val userId: String) :
: IntegrationManagerService.Listener, SessionLifecycleObserver {
IntegrationManagerService.Listener, SessionLifecycleObserver {
private val lifecycleOwner: LifecycleOwner = LifecycleOwner { lifecycleRegistry }
private val lifecycleRegistry: LifecycleRegistry = LifecycleRegistry(lifecycleOwner)

View file

@ -25,7 +25,7 @@ internal interface Task<PARAMS, RESULT> {
suspend fun execute(params: PARAMS): RESULT
suspend fun executeRetry(params: PARAMS, remainingRetry: Int) : RESULT {
suspend fun executeRetry(params: PARAMS, remainingRetry: Int): RESULT {
return try {
execute(params)
} catch (failure: Throwable) {

View file

@ -19,7 +19,7 @@ package org.matrix.android.sdk.internal.util.system
import android.os.Build
import javax.inject.Inject
internal class DefaultBuildVersionSdkIntProvider @Inject constructor()
: BuildVersionSdkIntProvider {
internal class DefaultBuildVersionSdkIntProvider @Inject constructor() :
BuildVersionSdkIntProvider {
override fun get() = Build.VERSION.SDK_INT
}

View file

@ -19,8 +19,8 @@ import android.content.Context
import androidx.work.Worker
import androidx.work.WorkerParameters
internal class AlwaysSuccessfulWorker(context: Context, params: WorkerParameters)
: Worker(context, params) {
internal class AlwaysSuccessfulWorker(context: Context, params: WorkerParameters) :
Worker(context, params) {
override fun doWork(): Result {
return Result.success()

View file

@ -26,8 +26,8 @@ import javax.inject.Inject
* No op interceptor
*/
@MatrixScope
internal class CurlLoggingInterceptor @Inject constructor()
: Interceptor {
internal class CurlLoggingInterceptor @Inject constructor() :
Interceptor {
@Throws(IOException::class)
override fun intercept(chain: Interceptor.Chain): Response {

View file

@ -24,7 +24,7 @@ import org.matrix.android.sdk.MatrixTest
import org.matrix.android.sdk.api.pushrules.rest.PushRule
import org.matrix.android.sdk.internal.di.MoshiProvider
class PushRuleActionsTest: MatrixTest {
class PushRuleActionsTest : MatrixTest {
@Test
fun test_action_parsing() {

View file

@ -24,7 +24,7 @@ import org.junit.runners.MethodSorters
import org.matrix.android.sdk.MatrixTest
@FixMethodOrder(MethodSorters.JVM)
class Base58Test: MatrixTest {
class Base58Test : MatrixTest {
@Test
fun encode() {

View file

@ -23,7 +23,7 @@ import org.junit.Assert.assertTrue
import org.junit.Test
import org.matrix.android.sdk.MatrixTest
class RecoveryKeyTest: MatrixTest {
class RecoveryKeyTest : MatrixTest {
private val curve25519Key = byteArrayOf(
0x77.toByte(), 0x07.toByte(), 0x6D.toByte(), 0x0A.toByte(), 0x73.toByte(), 0x18.toByte(), 0xA5.toByte(), 0x7D.toByte(),

View file

@ -21,7 +21,7 @@ import org.junit.Test
import org.matrix.android.sdk.MatrixTest
import org.matrix.android.sdk.internal.util.md5
class HelperTest: MatrixTest {
class HelperTest : MatrixTest {
@Test
fun testHash_ok() {

View file

@ -27,7 +27,7 @@ import org.junit.Test
import org.matrix.android.sdk.MatrixTest
import java.util.concurrent.Executors
class CoroutineSequencersTest: MatrixTest {
class CoroutineSequencersTest : MatrixTest {
private val dispatcher = Executors.newSingleThreadExecutor().asCoroutineDispatcher()

View file

@ -129,7 +129,7 @@ fun activityIdlingResource(activityClass: Class<*>): IdlingResource {
private var callback: IdlingResource.ResourceCallback? = null
var hasResumed = false
private var currentActivity : Activity? = null
private var currentActivity: Activity? = null
val uniqTS = System.currentTimeMillis()
override fun getName() = "activityIdlingResource_${activityClass.name}_$uniqTS"

View file

@ -27,8 +27,8 @@ import javax.inject.Inject
* Test that the application is started on boot
*/
class TestAutoStartBoot @Inject constructor(private val vectorPreferences: VectorPreferences,
private val stringProvider: StringProvider)
: TroubleshootTest(R.string.settings_troubleshoot_test_service_boot_title) {
private val stringProvider: StringProvider) :
TroubleshootTest(R.string.settings_troubleshoot_test_service_boot_title) {
override fun perform(activityResultLauncher: ActivityResultLauncher<Intent>) {
if (vectorPreferences.autoStartOnBoot()) {

View file

@ -27,8 +27,8 @@ import im.vector.app.features.settings.troubleshoot.TroubleshootTest
import javax.inject.Inject
class TestBackgroundRestrictions @Inject constructor(private val context: AppCompatActivity,
private val stringProvider: StringProvider)
: TroubleshootTest(R.string.settings_troubleshoot_test_bg_restricted_title) {
private val stringProvider: StringProvider) :
TroubleshootTest(R.string.settings_troubleshoot_test_bg_restricted_title) {
override fun perform(activityResultLauncher: ActivityResultLauncher<Intent>) {
context.getSystemService<ConnectivityManager>()!!.apply {

View file

@ -30,8 +30,8 @@ import javax.inject.Inject
* Check that the play services APK is available an up-to-date. If needed provide quick fix to install it.
*/
class TestPlayServices @Inject constructor(private val context: AppCompatActivity,
private val stringProvider: StringProvider)
: TroubleshootTest(R.string.settings_troubleshoot_test_play_services_title) {
private val stringProvider: StringProvider) :
TroubleshootTest(R.string.settings_troubleshoot_test_play_services_title) {
override fun perform(activityResultLauncher: ActivityResultLauncher<Intent>) {
val apiAvailability = GoogleApiAvailability.getInstance()

View file

@ -40,8 +40,8 @@ class TestPushFromPushGateway @Inject constructor(private val context: AppCompat
private val stringProvider: StringProvider,
private val errorFormatter: ErrorFormatter,
private val pushersManager: PushersManager,
private val activeSessionHolder: ActiveSessionHolder)
: TroubleshootTest(R.string.settings_troubleshoot_test_push_loop_title) {
private val activeSessionHolder: ActiveSessionHolder) :
TroubleshootTest(R.string.settings_troubleshoot_test_push_loop_title) {
private var action: Job? = null
private var pushReceived: Boolean = false

View file

@ -36,8 +36,8 @@ import javax.inject.Inject
class TestTokenRegistration @Inject constructor(private val context: AppCompatActivity,
private val stringProvider: StringProvider,
private val pushersManager: PushersManager,
private val activeSessionHolder: ActiveSessionHolder)
: TroubleshootTest(R.string.settings_troubleshoot_test_token_registration_title) {
private val activeSessionHolder: ActiveSessionHolder) :
TroubleshootTest(R.string.settings_troubleshoot_test_token_registration_title) {
override fun perform(activityResultLauncher: ActivityResultLauncher<Intent>) {
// Check if we have a registered pusher for this token

View file

@ -23,8 +23,8 @@ import org.threeten.bp.format.DateTimeFormatter
import javax.inject.Inject
class DefaultDateFormatterProvider @Inject constructor(private val context: Context,
private val localeProvider: LocaleProvider)
: DateFormatterProvider {
private val localeProvider: LocaleProvider) :
DateFormatterProvider {
override val dateWithMonthFormatter: DateTimeFormatter by lazy {
val pattern = DateFormat.getBestDateTimePattern(localeProvider.current(), "d MMMMM")

View file

@ -57,7 +57,7 @@ fun CharSequence.isMsisdn(): Boolean {
* - "fi.le.txt".insertBeforeLast("_foo") will return "fi.le_foo.txt"
* - null.insertBeforeLast("_foo") will return "_foo"
*/
fun String?.insertBeforeLast(insert: String, delimiter: String = ".") : String {
fun String?.insertBeforeLast(insert: String, delimiter: String = "."): String {
if (this == null) return insert
val idx = lastIndexOf(delimiter)
return if (idx == -1) {

View file

@ -42,8 +42,8 @@ class AvatarPlaceholderModelLoaderFactory(private val context: Context) : ModelL
}
}
class AvatarPlaceholderModelLoader(private val context: Context)
: ModelLoader<AvatarPlaceholder, Drawable> {
class AvatarPlaceholderModelLoader(private val context: Context) :
ModelLoader<AvatarPlaceholder, Drawable> {
override fun buildLoadData(model: AvatarPlaceholder, width: Int, height: Int, options: Options): ModelLoader.LoadData<Drawable>? {
return ModelLoader.LoadData(ObjectKey(model), AvatarPlaceholderDataFetcher(context, model))
@ -54,8 +54,8 @@ class AvatarPlaceholderModelLoader(private val context: Context)
}
}
class AvatarPlaceholderDataFetcher(context: Context, private val data: AvatarPlaceholder)
: DataFetcher<Drawable> {
class AvatarPlaceholderDataFetcher(context: Context, private val data: AvatarPlaceholder) :
DataFetcher<Drawable> {
private val avatarRenderer = context.vectorComponent().avatarRenderer()

View file

@ -48,8 +48,8 @@ class VectorGlideModelLoaderFactory(private val context: Context) : ModelLoaderF
}
}
class VectorGlideModelLoader(private val context: Context)
: ModelLoader<ImageContentRenderer.Data, InputStream> {
class VectorGlideModelLoader(private val context: Context) :
ModelLoader<ImageContentRenderer.Data, InputStream> {
override fun handles(model: ImageContentRenderer.Data): Boolean {
// Always handle
return true
@ -63,8 +63,8 @@ class VectorGlideModelLoader(private val context: Context)
class VectorGlideDataFetcher(context: Context,
private val data: ImageContentRenderer.Data,
private val width: Int,
private val height: Int)
: DataFetcher<InputStream> {
private val height: Int) :
DataFetcher<InputStream> {
private val localFilesHelper = LocalFilesHelper(context)
private val activeSessionHolder = context.vectorComponent().activeSessionHolder()

View file

@ -28,8 +28,8 @@ import im.vector.app.core.epoxy.ClickListener
import im.vector.app.core.epoxy.onClick
import im.vector.app.databinding.ViewButtonStateBinding
class ButtonStateView @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null, defStyle: Int = 0)
: FrameLayout(context, attrs, defStyle) {
class ButtonStateView @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null, defStyle: Int = 0) :
FrameLayout(context, attrs, defStyle) {
sealed class State {
object Button : State()

View file

@ -24,8 +24,8 @@ import im.vector.app.R
private const val DEFAULT_MAX_HEIGHT = 200
class MaxHeightScrollView @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null, defStyle: Int = 0)
: NestedScrollView(context, attrs, defStyle) {
class MaxHeightScrollView @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null, defStyle: Int = 0) :
NestedScrollView(context, attrs, defStyle) {
var maxHeight: Int = 0
set(value) {

View file

@ -26,8 +26,8 @@ import im.vector.app.R
import im.vector.app.core.extensions.updateConstraintSet
import im.vector.app.databinding.ViewStateBinding
class StateView @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null, defStyle: Int = 0)
: FrameLayout(context, attrs, defStyle) {
class StateView @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null, defStyle: Int = 0) :
FrameLayout(context, attrs, defStyle) {
sealed class State {
object Content : State()

View file

@ -25,5 +25,5 @@ interface VectorSharedAction
/**
* Parent class to handle navigation events, action events, or other any events
*/
open class VectorSharedActionViewModel<T : VectorSharedAction>(private val store: MutableDataSource<T> = PublishDataSource())
: ViewModel(), MutableDataSource<T> by store
open class VectorSharedActionViewModel<T : VectorSharedAction>(private val store: MutableDataSource<T> = PublishDataSource()) :
ViewModel(), MutableDataSource<T> by store

View file

@ -27,8 +27,8 @@ import im.vector.app.core.utils.PublishDataSource
import io.reactivex.Observable
import io.reactivex.Single
abstract class VectorViewModel<S : MvRxState, VA : VectorViewModelAction, VE : VectorViewEvents>(initialState: S)
: BaseMvRxViewModel<S>(initialState, false) {
abstract class VectorViewModel<S : MvRxState, VA : VectorViewModelAction, VE : VectorViewEvents>(initialState: S) :
BaseMvRxViewModel<S>(initialState, false) {
interface Factory<S : MvRxState> {
fun create(state: S): BaseMvRxViewModel<S>

View file

@ -20,8 +20,8 @@ import com.airbnb.epoxy.TypedEpoxyController
/**
* Epoxy controller for generic bottom sheet actions
*/
abstract class BottomSheetGenericController<State : BottomSheetGenericState, Action : BottomSheetGenericRadioAction>
: TypedEpoxyController<State>() {
abstract class BottomSheetGenericController<State : BottomSheetGenericState, Action : BottomSheetGenericRadioAction> :
TypedEpoxyController<State>() {
var listener: Listener<Action>? = null

View file

@ -49,7 +49,7 @@ class NotificationAreaView @JvmOverloads constructor(
var delegate: Delegate? = null
private var state: State = State.Initial
private lateinit var views : ViewNotificationAreaBinding
private lateinit var views: ViewNotificationAreaBinding
init {
setupView()

View file

@ -35,8 +35,8 @@ import im.vector.app.databinding.ViewPasswordStrengthBarBinding
class PasswordStrengthBar @JvmOverloads constructor(
context: Context,
attrs: AttributeSet? = null,
defStyleAttr: Int = 0)
: LinearLayout(context, attrs, defStyleAttr) {
defStyleAttr: Int = 0) :
LinearLayout(context, attrs, defStyleAttr) {
private val views: ViewPasswordStrengthBarBinding

View file

@ -37,7 +37,7 @@ class ReadReceiptsView @JvmOverloads constructor(
defStyleAttr: Int = 0
) : LinearLayout(context, attrs, defStyleAttr) {
private val views : ViewReadReceiptsBinding
private val views: ViewReadReceiptsBinding
init {
setupView()

View file

@ -52,8 +52,7 @@ private var permissionDialogDisplayed = false
* So when the user does not grant the permission and check the box do not ask again, this boolean will be false.
* Only useful if the first boolean is false
*/
fun ComponentActivity.registerForPermissionsResult(lambda: (allGranted: Boolean, deniedPermanently: Boolean) -> Unit)
: ActivityResultLauncher<Array<String>> {
fun ComponentActivity.registerForPermissionsResult(lambda: (allGranted: Boolean, deniedPermanently: Boolean) -> Unit): ActivityResultLauncher<Array<String>> {
return registerForActivityResult(ActivityResultContracts.RequestMultiplePermissions()) { result ->
onPermissionResult(result, lambda)
}

View file

@ -53,8 +53,8 @@ private const val ANIMATION_DURATION = 250
*/
class AttachmentTypeSelectorView(context: Context,
inflater: LayoutInflater,
var callback: Callback?)
: PopupWindow(context) {
var callback: Callback?) :
PopupWindow(context) {
interface Callback {
fun onTypeSelected(type: Type)

View file

@ -20,8 +20,8 @@ package im.vector.app.features.attachments.preview
import im.vector.app.core.extensions.exhaustive
import im.vector.app.core.platform.VectorViewModel
class AttachmentsPreviewViewModel(initialState: AttachmentsPreviewViewState)
: VectorViewModel<AttachmentsPreviewViewState, AttachmentsPreviewAction, AttachmentsPreviewViewEvents>(initialState) {
class AttachmentsPreviewViewModel(initialState: AttachmentsPreviewViewState) :
VectorViewModel<AttachmentsPreviewViewState, AttachmentsPreviewAction, AttachmentsPreviewViewEvents>(initialState) {
override fun handle(action: AttachmentsPreviewAction) {
when (action) {

View file

@ -25,9 +25,9 @@ sealed class VectorCallViewActions : VectorViewModelAction {
object DeclineCall : VectorCallViewActions()
object ToggleMute : VectorCallViewActions()
object ToggleVideo : VectorCallViewActions()
object ToggleHoldResume: VectorCallViewActions()
object ToggleHoldResume : VectorCallViewActions()
data class ChangeAudioDevice(val device: CallAudioManager.Device) : VectorCallViewActions()
object OpenDialPad: VectorCallViewActions()
object OpenDialPad : VectorCallViewActions()
data class SendDtmfDigit(val digit: String) : VectorCallViewActions()
data class SwitchCall(val callArgs: CallArgs) : VectorCallViewActions()
@ -36,5 +36,5 @@ sealed class VectorCallViewActions : VectorViewModelAction {
object ToggleCamera : VectorCallViewActions()
object ToggleHDSD : VectorCallViewActions()
object InitiateCallTransfer : VectorCallViewActions()
object TransferCall: VectorCallViewActions()
object TransferCall : VectorCallViewActions()
}

View file

@ -27,8 +27,8 @@ sealed class VectorCallViewEvents : VectorViewEvents {
val available: Set<CallAudioManager.Device>,
val current: CallAudioManager.Device
) : VectorCallViewEvents()
object ShowDialPad: VectorCallViewEvents()
object ShowCallTransferScreen: VectorCallViewEvents()
object ShowDialPad : VectorCallViewEvents()
object ShowCallTransferScreen : VectorCallViewEvents()
// data class CallAnswered(val content: CallAnswerContent) : VectorCallViewEvents()
// data class CallHangup(val content: CallHangupContent) : VectorCallViewEvents()
// object CallAccepted : VectorCallViewEvents()

View file

@ -51,8 +51,8 @@ class ConferenceEventEmitter(private val context: Context) {
}
class ConferenceEventObserver(private val context: Context,
private val onBroadcastEvent: (ConferenceEvent) -> Unit)
: LifecycleObserver {
private val onBroadcastEvent: (ConferenceEvent) -> Unit) :
LifecycleObserver {
// See https://jitsi.github.io/handbook/docs/dev-guide/dev-guide-android-sdk#listening-for-broadcasted-events
private val broadcastReceiver = object : BroadcastReceiver() {

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