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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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() {

View File

@ -37,8 +37,8 @@ import org.matrix.android.sdk.api.session.call.MxCall
class CallTransferViewModel @AssistedInject constructor(@Assisted initialState: CallTransferViewState,
private val dialPadLookup: DialPadLookup,
private val directRoomHelper: DirectRoomHelper,
private val callManager: WebRtcCallManager)
: VectorViewModel<CallTransferViewState, CallTransferAction, CallTransferViewEvents>(initialState) {
private val callManager: WebRtcCallManager) :
VectorViewModel<CallTransferViewState, CallTransferAction, CallTransferViewEvents>(initialState) {
@AssistedFactory
interface Factory {

View File

@ -41,8 +41,8 @@ import timber.log.Timber
class ContactsBookViewModel @AssistedInject constructor(@Assisted
initialState: ContactsBookViewState,
private val contactsDataSource: ContactsDataSource,
private val session: Session)
: VectorViewModel<ContactsBookViewState, ContactsBookAction, EmptyViewEvents>(initialState) {
private val session: Session) :
VectorViewModel<ContactsBookViewState, ContactsBookAction, EmptyViewEvents>(initialState) {
@AssistedFactory
interface Factory {

View File

@ -41,8 +41,8 @@ import org.matrix.android.sdk.api.session.room.model.create.CreateRoomParams
class CreateDirectRoomViewModel @AssistedInject constructor(@Assisted
initialState: CreateDirectRoomViewState,
private val rawService: RawService,
val session: Session)
: VectorViewModel<CreateDirectRoomViewState, CreateDirectRoomAction, CreateDirectRoomViewEvents>(initialState) {
val session: Session) :
VectorViewModel<CreateDirectRoomViewState, CreateDirectRoomAction, CreateDirectRoomViewEvents>(initialState) {
@AssistedFactory
interface Factory {

View File

@ -30,8 +30,8 @@ import im.vector.app.databinding.FragmentKeysBackupRestoreFromKeyBinding
import org.matrix.android.sdk.api.extensions.tryOrNull
import javax.inject.Inject
class KeysBackupRestoreFromKeyFragment @Inject constructor()
: VectorBaseFragment<FragmentKeysBackupRestoreFromKeyBinding>() {
class KeysBackupRestoreFromKeyFragment @Inject constructor() :
VectorBaseFragment<FragmentKeysBackupRestoreFromKeyBinding>() {
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentKeysBackupRestoreFromKeyBinding {
return FragmentKeysBackupRestoreFromKeyBinding.inflate(inflater, container, false)

View File

@ -26,5 +26,5 @@ import org.matrix.android.sdk.internal.crypto.keysbackup.model.rest.KeysVersionR
data class KeysBackupSettingViewState(val keysBackupVersionTrust: Async<KeysBackupVersionTrust> = Uninitialized,
val keysBackupState: KeysBackupState? = null,
val keysBackupVersion: KeysVersionResult? = null,
val deleteBackupRequest: Async<Unit> = Uninitialized)
: MvRxState
val deleteBackupRequest: Async<Unit> = Uninitialized) :
MvRxState

View File

@ -31,8 +31,8 @@ import im.vector.app.features.crypto.keysbackup.restore.KeysBackupRestoreActivit
import im.vector.app.features.crypto.keysbackup.setup.KeysBackupSetupActivity
import javax.inject.Inject
class KeysBackupSettingsFragment @Inject constructor(private val keysBackupSettingsRecyclerViewController: KeysBackupSettingsRecyclerViewController)
: VectorBaseFragment<FragmentKeysBackupSettingsBinding>(),
class KeysBackupSettingsFragment @Inject constructor(private val keysBackupSettingsRecyclerViewController: KeysBackupSettingsRecyclerViewController) :
VectorBaseFragment<FragmentKeysBackupSettingsBinding>(),
KeysBackupSettingsRecyclerViewController.Listener {
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentKeysBackupSettingsBinding {

View File

@ -67,8 +67,8 @@ class SharedSecureStorageViewModel @AssistedInject constructor(
@Assisted initialState: SharedSecureStorageViewState,
@Assisted val args: SharedSecureStorageActivity.Args,
private val stringProvider: StringProvider,
private val session: Session)
: VectorViewModel<SharedSecureStorageViewState, SharedSecureStorageAction, SharedSecureStorageViewEvent>(initialState) {
private val session: Session) :
VectorViewModel<SharedSecureStorageViewState, SharedSecureStorageAction, SharedSecureStorageViewEvent>(initialState) {
@AssistedFactory
interface Factory {

View File

@ -29,8 +29,8 @@ import im.vector.app.databinding.FragmentSsssResetAllBinding
import im.vector.app.features.roommemberprofile.devices.DeviceListBottomSheet
import javax.inject.Inject
class SharedSecuredStorageResetAllFragment @Inject constructor()
: VectorBaseFragment<FragmentSsssResetAllBinding>() {
class SharedSecuredStorageResetAllFragment @Inject constructor() :
VectorBaseFragment<FragmentSsssResetAllBinding>() {
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentSsssResetAllBinding {
return FragmentSsssResetAllBinding.inflate(inflater, container, false)

View File

@ -34,8 +34,8 @@ import io.reactivex.android.schedulers.AndroidSchedulers
import java.util.concurrent.TimeUnit
import javax.inject.Inject
class BootstrapConfirmPassphraseFragment @Inject constructor()
: VectorBaseFragment<FragmentBootstrapEnterPassphraseBinding>() {
class BootstrapConfirmPassphraseFragment @Inject constructor() :
VectorBaseFragment<FragmentBootstrapEnterPassphraseBinding>() {
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentBootstrapEnterPassphraseBinding {
return FragmentBootstrapEnterPassphraseBinding.inflate(inflater, container, false)

View File

@ -33,8 +33,8 @@ import io.reactivex.android.schedulers.AndroidSchedulers
import java.util.concurrent.TimeUnit
import javax.inject.Inject
class BootstrapEnterPassphraseFragment @Inject constructor()
: VectorBaseFragment<FragmentBootstrapEnterPassphraseBinding>() {
class BootstrapEnterPassphraseFragment @Inject constructor() :
VectorBaseFragment<FragmentBootstrapEnterPassphraseBinding>() {
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentBootstrapEnterPassphraseBinding {
return FragmentBootstrapEnterPassphraseBinding.inflate(inflater, container, false)

View File

@ -28,8 +28,8 @@ import im.vector.app.core.platform.VectorBaseFragment
import im.vector.app.databinding.FragmentBootstrapSetupRecoveryBinding
import javax.inject.Inject
class BootstrapSetupRecoveryKeyFragment @Inject constructor()
: VectorBaseFragment<FragmentBootstrapSetupRecoveryBinding>() {
class BootstrapSetupRecoveryKeyFragment @Inject constructor() :
VectorBaseFragment<FragmentBootstrapSetupRecoveryBinding>() {
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentBootstrapSetupRecoveryBinding {
return FragmentBootstrapSetupRecoveryBinding.inflate(inflater, container, false)

View File

@ -25,8 +25,8 @@ import im.vector.app.core.platform.VectorBaseFragment
import im.vector.app.databinding.FragmentBootstrapWaitingBinding
import javax.inject.Inject
class BootstrapWaitingFragment @Inject constructor()
: VectorBaseFragment<FragmentBootstrapWaitingBinding>() {
class BootstrapWaitingFragment @Inject constructor() :
VectorBaseFragment<FragmentBootstrapWaitingBinding>() {
override fun getBinding(inflater: LayoutInflater, container: ViewGroup?): FragmentBootstrapWaitingBinding {
return FragmentBootstrapWaitingBinding.inflate(inflater, container, false)

View File

@ -86,8 +86,8 @@ class VerificationBottomSheetViewModel @AssistedInject constructor(
@Assisted val args: VerificationBottomSheet.VerificationArgs,
private val session: Session,
private val supportedVerificationMethodsProvider: SupportedVerificationMethodsProvider,
private val stringProvider: StringProvider)
: VectorViewModel<VerificationBottomSheetViewState, VerificationAction, VerificationBottomSheetViewEvents>(initialState),
private val stringProvider: StringProvider) :
VectorViewModel<VerificationBottomSheetViewState, VerificationAction, VerificationBottomSheetViewEvents>(initialState),
VerificationService.Listener {
init {

View File

@ -35,8 +35,8 @@ enum class ConclusionState {
CANCELLED
}
class VerificationConclusionViewModel(initialState: VerificationConclusionViewState)
: VectorViewModel<VerificationConclusionViewState, EmptyAction, EmptyViewEvents>(initialState) {
class VerificationConclusionViewModel(initialState: VerificationConclusionViewState) :
VectorViewModel<VerificationConclusionViewState, EmptyAction, EmptyViewEvents>(initialState) {
companion object : MvRxViewModelFactory<VerificationConclusionViewModel, VerificationConclusionViewState> {

View File

@ -28,8 +28,8 @@ import im.vector.app.core.platform.VectorBaseFragment
import im.vector.app.databinding.FragmentDevtoolsEditorBinding
import javax.inject.Inject
class RoomDevToolEditFragment @Inject constructor()
: VectorBaseFragment<FragmentDevtoolsEditorBinding>() {
class RoomDevToolEditFragment @Inject constructor() :
VectorBaseFragment<FragmentDevtoolsEditorBinding>() {
private val sharedViewModel: RoomDevToolViewModel by activityViewModel()

View File

@ -39,8 +39,8 @@ import org.matrix.android.sdk.rx.rx
class DiscoverySettingsViewModel @AssistedInject constructor(
@Assisted initialState: DiscoverySettingsState,
private val session: Session)
: VectorViewModel<DiscoverySettingsState, DiscoverySettingsAction, DiscoverySettingsViewEvents>(initialState) {
private val session: Session) :
VectorViewModel<DiscoverySettingsState, DiscoverySettingsAction, DiscoverySettingsViewEvents>(initialState) {
@AssistedFactory
interface Factory {

View File

@ -38,8 +38,8 @@ import java.net.UnknownHostException
class SetIdentityServerViewModel @AssistedInject constructor(
@Assisted initialState: SetIdentityServerState,
private val mxSession: Session,
stringProvider: StringProvider)
: VectorViewModel<SetIdentityServerState, SetIdentityServerAction, SetIdentityServerViewEvents>(initialState) {
stringProvider: StringProvider) :
VectorViewModel<SetIdentityServerState, SetIdentityServerAction, SetIdentityServerViewEvents>(initialState) {
@AssistedFactory
interface Factory {

View File

@ -63,8 +63,8 @@ class HomeDetailViewModel @AssistedInject constructor(@Assisted initialState: Ho
private val callManager: WebRtcCallManager,
private val directRoomHelper: DirectRoomHelper,
private val appStateHandler: AppStateHandler,
private val autoAcceptInvites: AutoAcceptInvites)
: VectorViewModel<HomeDetailViewState, HomeDetailAction, HomeDetailViewEvents>(initialState),
private val autoAcceptInvites: AutoAcceptInvites) :
VectorViewModel<HomeDetailViewState, HomeDetailAction, HomeDetailViewEvents>(initialState),
CallProtocolsChecker.Listener {
@AssistedFactory

View File

@ -58,8 +58,8 @@ data class DeviceDetectionInfo(
class UnknownDeviceDetectorSharedViewModel @AssistedInject constructor(@Assisted initialState: UnknownDevicesState,
session: Session,
private val vectorPreferences: VectorPreferences)
: VectorViewModel<UnknownDevicesState, UnknownDeviceDetectorSharedViewModel.Action, EmptyViewEvents>(initialState) {
private val vectorPreferences: VectorPreferences) :
VectorViewModel<UnknownDevicesState, UnknownDeviceDetectorSharedViewModel.Action, EmptyViewEvents>(initialState) {
sealed class Action : VectorViewModelAction {
data class IgnoreDevice(val deviceIds: List<String>) : Action()

View File

@ -57,8 +57,8 @@ class UnreadMessagesSharedViewModel @AssistedInject constructor(@Assisted initia
session: Session,
private val vectorPreferences: VectorPreferences,
appStateHandler: AppStateHandler,
private val autoAcceptInvites: AutoAcceptInvites)
: VectorViewModel<UnreadMessagesState, EmptyAction, EmptyViewEvents>(initialState) {
private val autoAcceptInvites: AutoAcceptInvites) :
VectorViewModel<UnreadMessagesState, EmptyAction, EmptyViewEvents>(initialState) {
@AssistedFactory
interface Factory {

View File

@ -33,8 +33,8 @@ import org.matrix.android.sdk.api.session.room.roomSummaryQueryParams
import org.matrix.android.sdk.rx.rx
class BreadcrumbsViewModel @AssistedInject constructor(@Assisted initialState: BreadcrumbsViewState,
private val session: Session)
: VectorViewModel<BreadcrumbsViewState, EmptyAction, EmptyViewEvents>(initialState) {
private val session: Session) :
VectorViewModel<BreadcrumbsViewState, EmptyAction, EmptyViewEvents>(initialState) {
@AssistedFactory
interface Factory {

View File

@ -32,8 +32,8 @@ import im.vector.app.core.platform.SimpleTextWatcher
import im.vector.app.features.html.PillImageSpan
import timber.log.Timber
class ComposerEditText @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = android.R.attr.editTextStyle)
: EmojiEditText(context, attrs, defStyleAttr) {
class ComposerEditText @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = android.R.attr.editTextStyle) :
EmojiEditText(context, attrs, defStyleAttr) {
interface Callback {
fun onRichContentSelected(contentUri: Uri): Boolean

View File

@ -30,8 +30,8 @@ import javax.inject.Inject
*/
class DisplayReadReceiptsController @Inject constructor(private val dateFormatter: VectorDateFormatter,
private val session: Session,
private val avatarRender: AvatarRenderer)
: TypedEpoxyController<List<ReadReceiptData>>() {
private val avatarRender: AvatarRenderer) :
TypedEpoxyController<List<ReadReceiptData>>() {
var listener: Listener? = null

View File

@ -26,8 +26,8 @@ data class ViewEditHistoryViewState(
val eventId: String,
val roomId: String,
val isOriginalAReply: Boolean = false,
val editList: Async<List<Event>> = Uninitialized)
: MvRxState {
val editList: Async<List<Event>> = Uninitialized) :
MvRxState {
constructor(args: TimelineEventFragmentArgs) : this(roomId = args.roomId, eventId = args.eventId)
}

View File

@ -63,8 +63,7 @@ class MergedHeaderItemFactory @Inject constructor(private val activeSessionHolde
currentPosition: Int,
eventIdToHighlight: String?,
callback: TimelineEventController.Callback?,
requestModelBuild: () -> Unit)
: BasedMergedItem<*>? {
requestModelBuild: () -> Unit): BasedMergedItem<*>? {
return if (nextEvent?.root?.getClearType() == EventType.STATE_ROOM_CREATE &&
event.isRoomConfiguration(nextEvent.root.getClearContent()?.toModel<RoomCreateContent>()?.creator)) {
// It's the first item before room.create

View File

@ -21,8 +21,8 @@ import im.vector.app.core.epoxy.VectorEpoxyModel
import im.vector.app.features.home.room.detail.timeline.TimelineEventController
import org.matrix.android.sdk.api.session.room.timeline.TimelineEvent
class ReadMarkerVisibilityStateChangedListener(private val callback: TimelineEventController.Callback?)
: VectorEpoxyModel.OnVisibilityStateChangedListener {
class ReadMarkerVisibilityStateChangedListener(private val callback: TimelineEventController.Callback?) :
VectorEpoxyModel.OnVisibilityStateChangedListener {
override fun onVisibilityStateChanged(visibilityState: Int) {
if (visibilityState == VisibilityState.VISIBLE) {
@ -32,8 +32,8 @@ class ReadMarkerVisibilityStateChangedListener(private val callback: TimelineEve
}
class TimelineEventVisibilityStateChangedListener(private val callback: TimelineEventController.Callback?,
private val event: TimelineEvent)
: VectorEpoxyModel.OnVisibilityStateChangedListener {
private val event: TimelineEvent) :
VectorEpoxyModel.OnVisibilityStateChangedListener {
override fun onVisibilityStateChanged(visibilityState: Int) {
if (visibilityState == VisibilityState.VISIBLE) {
@ -45,8 +45,8 @@ class TimelineEventVisibilityStateChangedListener(private val callback: Timeline
}
class MergedTimelineEventVisibilityStateChangedListener(private val callback: TimelineEventController.Callback?,
private val events: List<TimelineEvent>)
: VectorEpoxyModel.OnVisibilityStateChangedListener {
private val events: List<TimelineEvent>) :
VectorEpoxyModel.OnVisibilityStateChangedListener {
override fun onVisibilityStateChanged(visibilityState: Int) {
if (visibilityState == VisibilityState.VISIBLE) {

View File

@ -32,8 +32,8 @@ import javax.inject.Inject
*/
class ViewReactionsEpoxyController @Inject constructor(
private val stringProvider: StringProvider,
private val emojiCompatWrapper: EmojiCompatWrapper)
: TypedEpoxyController<DisplayReactionsViewState>() {
private val emojiCompatWrapper: EmojiCompatWrapper) :
TypedEpoxyController<DisplayReactionsViewState>() {
var listener: Listener? = null

View File

@ -41,8 +41,8 @@ import org.matrix.android.sdk.rx.unwrap
data class DisplayReactionsViewState(
val eventId: String,
val roomId: String,
val mapReactionKeyToMemberList: Async<List<ReactionInfo>> = Uninitialized)
: MvRxState {
val mapReactionKeyToMemberList: Async<List<ReactionInfo>> = Uninitialized) :
MvRxState {
constructor(args: TimelineEventFragmentArgs) : this(roomId = args.roomId, eventId = args.eventId)
}

View File

@ -34,8 +34,8 @@ import org.matrix.android.sdk.api.session.Session
class MigrateRoomViewModel @AssistedInject constructor(
@Assisted initialState: MigrateRoomViewState,
private val session: Session,
private val upgradeRoomViewModelTask: UpgradeRoomViewModelTask)
: VectorViewModel<MigrateRoomViewState, MigrateRoomAction, EmptyViewEvents>(initialState) {
private val upgradeRoomViewModelTask: UpgradeRoomViewModelTask) :
VectorViewModel<MigrateRoomViewState, MigrateRoomAction, EmptyViewEvents>(initialState) {
init {
val room = session.getRoom(initialState.roomId)

View File

@ -30,8 +30,8 @@ import javax.inject.Inject
*/
class RoomWidgetsController @Inject constructor(
val stringProvider: StringProvider,
val colorProvider: ColorProvider)
: TypedEpoxyController<List<Widget>>() {
val colorProvider: ColorProvider) :
TypedEpoxyController<List<Widget>>() {
var listener: Listener? = null

View File

@ -18,8 +18,8 @@ package im.vector.app.features.home.room.list
import com.airbnb.epoxy.EpoxyController
abstract class CollapsableTypedEpoxyController<T>
: EpoxyController(), CollapsableControllerExtension {
abstract class CollapsableTypedEpoxyController<T> :
EpoxyController(), CollapsableControllerExtension {
private var currentData: T? = null
private var allowModelBuildRequests = false

View File

@ -28,8 +28,8 @@ class RoomListViewModelFactory @Inject constructor(private val session: Provider
private val appStateHandler: AppStateHandler,
private val stringProvider: StringProvider,
private val vectorPreferences: VectorPreferences,
private val autoAcceptInvites: AutoAcceptInvites)
: RoomListViewModel.Factory {
private val autoAcceptInvites: AutoAcceptInvites) :
RoomListViewModel.Factory {
override fun create(initialState: RoomListViewState): RoomListViewModel {
return RoomListViewModel(

View File

@ -24,8 +24,8 @@ import im.vector.app.core.platform.VectorSharedAction
sealed class RoomListQuickActionsSharedAction(
@StringRes val titleRes: Int,
@DrawableRes val iconResId: Int?,
val destructive: Boolean = false)
: VectorSharedAction {
val destructive: Boolean = false) :
VectorSharedAction {
data class NotificationsAllNoisy(val roomId: String) : RoomListQuickActionsSharedAction(
R.string.room_list_quick_actions_notifications_all_noisy,

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