Fix indentation for constructor params

This commit is contained in:
moezbhatti
2018-12-25 18:13:17 -05:00
parent a1dfba2e4b
commit 728af5168c
96 changed files with 482 additions and 476 deletions
@@ -22,9 +22,9 @@ import com.moez.QKSMS.model.Recipient
import javax.inject.Inject import javax.inject.Inject
class RecipientFilter @Inject constructor( class RecipientFilter @Inject constructor(
private val contactFilter: ContactFilter, private val contactFilter: ContactFilter,
private val phoneNumberFilter: PhoneNumberFilter) private val phoneNumberFilter: PhoneNumberFilter
: Filter<Recipient>() { ) : Filter<Recipient>() {
override fun filter(item: Recipient, query: CharSequence) = when { override fun filter(item: Recipient, query: CharSequence) = when {
item.contact?.let { contactFilter.filter(it, query) } == true -> true item.contact?.let { contactFilter.filter(it, query) } == true -> true
@@ -34,8 +34,8 @@ import javax.inject.Inject
* TODO: Stop listening automatically. Currently, this will only happen if the contact is added * TODO: Stop listening automatically. Currently, this will only happen if the contact is added
*/ */
class ContactAddedListenerImpl @Inject constructor( class ContactAddedListenerImpl @Inject constructor(
private val context: Context, private val context: Context,
private val syncRepo: SyncRepository private val syncRepo: SyncRepository
) : ContactAddedListener { ) : ContactAddedListener {
companion object { companion object {
@@ -35,8 +35,8 @@ import timber.log.Timber
import javax.inject.Inject import javax.inject.Inject
class ExternalBlockingManagerImpl @Inject constructor( class ExternalBlockingManagerImpl @Inject constructor(
private val context: Context, private val context: Context,
private val prefs: Preferences private val prefs: Preferences
) : ExternalBlockingManager { ) : ExternalBlockingManager {
companion object { companion object {
@@ -56,9 +56,9 @@ class ExternalBlockingManagerImpl @Inject constructor(
} }
private class Binder( private class Binder(
private val context: Context, private val context: Context,
private val prefs: Preferences, private val prefs: Preferences,
private val address: String private val address: String
) : ServiceConnection { ) : ServiceConnection {
private val subject: SingleSubject<Boolean> = SingleSubject.create() private val subject: SingleSubject<Boolean> = SingleSubject.create()
@@ -27,8 +27,8 @@ import com.moez.QKSMS.model.PhoneNumber
import javax.inject.Inject import javax.inject.Inject
class CursorToContactImpl @Inject constructor( class CursorToContactImpl @Inject constructor(
private val context: Context, private val context: Context,
private val permissionManager: PermissionManager private val permissionManager: PermissionManager
) : CursorToContact { ) : CursorToContact {
companion object { companion object {
@@ -28,8 +28,8 @@ import com.moez.QKSMS.model.Recipient
import javax.inject.Inject import javax.inject.Inject
class CursorToConversationImpl @Inject constructor( class CursorToConversationImpl @Inject constructor(
private val context: Context, private val context: Context,
private val permissionManager: PermissionManager private val permissionManager: PermissionManager
) : CursorToConversation { ) : CursorToConversation {
companion object { companion object {
@@ -35,11 +35,11 @@ import com.moez.QKSMS.util.tryOrNull
import javax.inject.Inject import javax.inject.Inject
class CursorToMessageImpl @Inject constructor( class CursorToMessageImpl @Inject constructor(
private val context: Context, private val context: Context,
private val cursorToPart: CursorToPart, private val cursorToPart: CursorToPart,
private val keys: KeyManager, private val keys: KeyManager,
private val permissionManager: PermissionManager, private val permissionManager: PermissionManager,
private val preferences: Preferences private val preferences: Preferences
) : CursorToMessage { ) : CursorToMessage {
private val uri = Uri.parse("content://mms-sms/complete-conversations") private val uri = Uri.parse("content://mms-sms/complete-conversations")
@@ -26,8 +26,8 @@ import com.moez.QKSMS.model.Recipient
import javax.inject.Inject import javax.inject.Inject
class CursorToRecipientImpl @Inject constructor( class CursorToRecipientImpl @Inject constructor(
private val context: Context, private val context: Context,
private val permissionManager: PermissionManager private val permissionManager: PermissionManager
) : CursorToRecipient { ) : CursorToRecipient {
companion object { companion object {
@@ -28,9 +28,9 @@ import io.reactivex.rxkotlin.Observables
import javax.inject.Inject import javax.inject.Inject
class RatingManagerImpl @Inject constructor( class RatingManagerImpl @Inject constructor(
rxPrefs: RxSharedPreferences, rxPrefs: RxSharedPreferences,
private val analyticsManager: AnalyticsManager, private val analyticsManager: AnalyticsManager,
private val ratingThresholdExperiment: RatingThresholdExperiment private val ratingThresholdExperiment: RatingThresholdExperiment
) : RatingManager { ) : RatingManager {
private val sessions = rxPrefs.getInteger("sessions", 0) private val sessions = rxPrefs.getInteger("sessions", 0)
@@ -62,8 +62,8 @@ class RatingManagerImpl @Inject constructor(
} }
class RatingThresholdExperiment @Inject constructor( class RatingThresholdExperiment @Inject constructor(
context: Context, context: Context,
analytics: AnalyticsManager analytics: AnalyticsManager
) : Experiment<Int>(context, analytics) { ) : Experiment<Int>(context, analytics) {
override val key: String = "Rating Threshold" override val key: String = "Rating Threshold"
@@ -49,7 +49,9 @@ class RemoteMessagingReceiver : BroadcastReceiver() {
markRead.execute(listOf(threadId)) markRead.execute(listOf(threadId))
val lastMessage = messageRepo.getMessages(threadId).lastOrNull() val lastMessage = messageRepo.getMessages(threadId).lastOrNull()
val subId = subscriptionManager.activeSubscriptionInfoList.firstOrNull { it.subscriptionId == lastMessage?.subId }?.subscriptionId ?: -1 val subId = subscriptionManager.activeSubscriptionInfoList
.firstOrNull { it.subscriptionId == lastMessage?.subId }
?.subscriptionId ?: -1
val addresses = conversationRepo.getConversation(threadId)?.recipients?.map { it.address } ?: return val addresses = conversationRepo.getConversation(threadId)?.recipients?.map { it.address } ?: return
val pendingRepository = goAsync() val pendingRepository = goAsync()
@@ -43,13 +43,13 @@ class SmsDeliveredReceiver : BroadcastReceiver() {
val id = intent.getLongExtra("id", 0L) val id = intent.getLongExtra("id", 0L)
when (resultCode) { when (resultCode) {
// TODO notify about delivery // TODO notify about delivery
Activity.RESULT_OK -> { Activity.RESULT_OK -> {
val pendingResult = goAsync() val pendingResult = goAsync()
markDelivered.execute(id) { pendingResult.finish() } markDelivered.execute(id) { pendingResult.finish() }
} }
// TODO notify about delivery failure // TODO notify about delivery failure
Activity.RESULT_CANCELED -> { Activity.RESULT_CANCELED -> {
val pendingResult = goAsync() val pendingResult = goAsync()
markDeliveryFailed.execute(MarkDeliveryFailed.Params(id, resultCode)) { pendingResult.finish() } markDeliveryFailed.execute(MarkDeliveryFailed.Params(id, resultCode)) { pendingResult.finish() }
@@ -45,9 +45,9 @@ import kotlin.concurrent.schedule
@Singleton @Singleton
class BackupRepositoryImpl @Inject constructor( class BackupRepositoryImpl @Inject constructor(
private val context: Context, private val context: Context,
private val moshi: Moshi, private val moshi: Moshi,
private val syncRepo: SyncRepository private val syncRepo: SyncRepository
) : BackupRepository { ) : BackupRepository {
companion object { companion object {
@@ -55,8 +55,8 @@ class BackupRepositoryImpl @Inject constructor(
} }
data class Backup( data class Backup(
val messageCount: Int = 0, val messageCount: Int = 0,
val messages: List<BackupMessage> = listOf() val messages: List<BackupMessage> = listOf()
) )
/** /**
@@ -64,21 +64,21 @@ class BackupRepositoryImpl @Inject constructor(
* needing to parse the entire file * needing to parse the entire file
*/ */
data class BackupMetadata( data class BackupMetadata(
val messageCount: Int = 0 val messageCount: Int = 0
) )
data class BackupMessage( data class BackupMessage(
val type: Int, val type: Int,
val address: String, val address: String,
val date: Long, val date: Long,
val dateSent: Long, val dateSent: Long,
val read: Boolean, val read: Boolean,
val status: Int, val status: Int,
val body: String, val body: String,
val protocol: Int, val protocol: Int,
val serviceCenter: String?, val serviceCenter: String?,
val locked: Boolean, val locked: Boolean,
val subId: Int) val subId: Int)
// Subjects to emit our progress events to // Subjects to emit our progress events to
private val backupProgress: Subject<BackupRepository.Progress> = BehaviorSubject.createDefault(BackupRepository.Progress.Idle()) private val backupProgress: Subject<BackupRepository.Progress> = BehaviorSubject.createDefault(BackupRepository.Progress.Idle())
@@ -39,8 +39,8 @@ import javax.inject.Singleton
@Singleton @Singleton
class ContactRepositoryImpl @Inject constructor( class ContactRepositoryImpl @Inject constructor(
private val context: Context, private val context: Context,
private val prefs: Preferences private val prefs: Preferences
) : ContactRepository { ) : ContactRepository {
override fun findContactUri(address: String): Single<Uri> { override fun findContactUri(address: String): Single<Uri> {
@@ -41,10 +41,10 @@ import java.util.concurrent.TimeUnit
import javax.inject.Inject import javax.inject.Inject
class ConversationRepositoryImpl @Inject constructor( class ConversationRepositoryImpl @Inject constructor(
private val context: Context, private val context: Context,
private val conversationFilter: ConversationFilter, private val conversationFilter: ConversationFilter,
private val cursorToConversation: CursorToConversation, private val cursorToConversation: CursorToConversation,
private val cursorToRecipient: CursorToRecipient private val cursorToRecipient: CursorToRecipient
) : ConversationRepository { ) : ConversationRepository {
override fun getConversations(archived: Boolean): RealmResults<Conversation> { override fun getConversations(archived: Boolean): RealmResults<Conversation> {
@@ -58,12 +58,13 @@ import javax.inject.Singleton
@Singleton @Singleton
class MessageRepositoryImpl @Inject constructor( class MessageRepositoryImpl @Inject constructor(
private val activeConversationManager: ActiveConversationManager, private val activeConversationManager: ActiveConversationManager,
private val context: Context, private val context: Context,
private val messageIds: KeyManager, private val messageIds: KeyManager,
private val imageRepository: ImageRepository, private val imageRepository: ImageRepository,
private val prefs: Preferences, private val prefs: Preferences,
private val syncRepository: SyncRepository) : MessageRepository { private val syncRepository: SyncRepository
) : MessageRepository {
override fun getMessages(threadId: Long, query: String): RealmResults<Message> { override fun getMessages(threadId: Long, query: String): RealmResults<Message> {
return Realm.getDefaultInstance() return Realm.getDefaultInstance()
@@ -47,25 +47,25 @@ import javax.inject.Singleton
@Singleton @Singleton
class SyncRepositoryImpl @Inject constructor( class SyncRepositoryImpl @Inject constructor(
private val contentResolver: ContentResolver, private val contentResolver: ContentResolver,
private val conversationRepo: ConversationRepository, private val conversationRepo: ConversationRepository,
private val cursorToConversation: CursorToConversation, private val cursorToConversation: CursorToConversation,
private val cursorToMessage: CursorToMessage, private val cursorToMessage: CursorToMessage,
private val cursorToRecipient: CursorToRecipient, private val cursorToRecipient: CursorToRecipient,
private val cursorToContact: CursorToContact, private val cursorToContact: CursorToContact,
private val keys: KeyManager, private val keys: KeyManager,
private val rxPrefs: RxSharedPreferences private val rxPrefs: RxSharedPreferences
) : SyncRepository { ) : SyncRepository {
/** /**
* Holds data that should be persisted across full syncs * Holds data that should be persisted across full syncs
*/ */
private data class PersistedData( private data class PersistedData(
val id: Long, val id: Long,
val archived: Boolean, val archived: Boolean,
val blocked: Boolean, val blocked: Boolean,
val pinned: Boolean, val pinned: Boolean,
val name: String) val name: String)
override val syncProgress: Subject<SyncRepository.SyncProgress> = BehaviorSubject.createDefault(SyncRepository.SyncProgress.Idle()) override val syncProgress: Subject<SyncRepository.SyncProgress> = BehaviorSubject.createDefault(SyncRepository.SyncProgress.Idle())
@@ -25,7 +25,7 @@ import io.reactivex.Observer
import io.reactivex.disposables.Disposable import io.reactivex.disposables.Disposable
class ActiveSubscriptionObservable( class ActiveSubscriptionObservable(
private val subscriptionManager: SubscriptionManagerCompat private val subscriptionManager: SubscriptionManagerCompat
) : Observable<List<SubscriptionInfoCompat>>() { ) : Observable<List<SubscriptionInfoCompat>>() {
override fun subscribeActual(observer: Observer<in List<SubscriptionInfoCompat>>) { override fun subscribeActual(observer: Observer<in List<SubscriptionInfoCompat>>) {
@@ -37,8 +37,8 @@ class ActiveSubscriptionObservable(
} }
internal class Listener( internal class Listener(
private val subscriptionManager: SubscriptionManagerCompat, private val subscriptionManager: SubscriptionManagerCompat,
private val observer: Observer<in List<SubscriptionInfoCompat>> private val observer: Observer<in List<SubscriptionInfoCompat>>
) : Disposable, SubscriptionManagerCompat.OnSubscriptionsChangedListener() { ) : Disposable, SubscriptionManagerCompat.OnSubscriptionsChangedListener() {
private var disposed: Boolean = false private var disposed: Boolean = false
@@ -38,8 +38,8 @@ import java.security.MessageDigest
class ContactImageLoader( class ContactImageLoader(
private val context: Context, private val context: Context,
private val contactRepo: ContactRepository private val contactRepo: ContactRepository
) : ModelLoader<String, InputStream> { ) : ModelLoader<String, InputStream> {
override fun handles(model: String): Boolean { override fun handles(model: String): Boolean {
@@ -60,9 +60,9 @@ class ContactImageLoader(
} }
class ContactImageFetcher( class ContactImageFetcher(
private val context: Context, private val context: Context,
private val contactRepo: ContactRepository, private val contactRepo: ContactRepository,
private val address: String private val address: String
) : DataFetcher<InputStream> { ) : DataFetcher<InputStream> {
private var loadPhotoDisposable: Disposable? = null private var loadPhotoDisposable: Disposable? = null
@@ -39,9 +39,9 @@ import java.nio.ByteBuffer
* Based on Glide's ReEncodingGifResourceEncoder * Based on Glide's ReEncodingGifResourceEncoder
*/ */
class GifEncoder internal constructor( class GifEncoder internal constructor(
private val context: Context, private val context: Context,
private val bitmapPool: BitmapPool, private val bitmapPool: BitmapPool,
private val factory: Factory = Factory() private val factory: Factory = Factory()
) { ) {
private val provider = GifBitmapProvider(bitmapPool) private val provider = GifBitmapProvider(bitmapPool)
@@ -32,9 +32,10 @@ import javax.inject.Singleton
@Singleton @Singleton
class NightModeManager @Inject constructor( class NightModeManager @Inject constructor(
private val context: Context, private val context: Context,
private val prefs: Preferences, private val prefs: Preferences,
private val widgetManager: WidgetManager) { private val widgetManager: WidgetManager
) {
fun updateCurrentTheme() { fun updateCurrentTheme() {
// If night mode is not on auto, then there's nothing to do here // If night mode is not on auto, then there's nothing to do here
@@ -30,13 +30,13 @@ import timber.log.Timber
object SqliteWrapper { object SqliteWrapper {
fun query( fun query(
context: Context, context: Context,
uri: Uri, uri: Uri,
projection: Array<String>? = null, projection: Array<String>? = null,
selection: String? = null, selection: String? = null,
selectionArgs: Array<String>? = null, selectionArgs: Array<String>? = null,
sortOrder: String? = null, sortOrder: String? = null,
logError: Boolean = true logError: Boolean = true
): Cursor? { ): Cursor? {
return try { return try {
context.contentResolver.query(uri, projection, selection, selectionArgs, sortOrder) context.contentResolver.query(uri, projection, selection, selectionArgs, sortOrder)
@@ -26,13 +26,11 @@ data class Optional<out T>(val value: T?) {
fun notNull() = value != null fun notNull() = value != null
} }
fun <T, R> Flowable<T>.mapNotNull(mapper: (T) -> R?): Flowable<R> fun <T, R> Flowable<T>.mapNotNull(mapper: (T) -> R?): Flowable<R> = map { input -> Optional(mapper(input)) }
= map { input -> Optional(mapper(input)) }
.filter { optional -> optional.notNull() } .filter { optional -> optional.notNull() }
.map { optional -> optional.value } .map { optional -> optional.value }
fun <T, R> Observable<T>.mapNotNull(mapper: (T) -> R?): Observable<R> fun <T, R> Observable<T>.mapNotNull(mapper: (T) -> R?): Observable<R> = map { input -> Optional(mapper(input)) }
= map { input -> Optional(mapper(input)) }
.filter { optional -> optional.notNull() } .filter { optional -> optional.notNull() }
.map { optional -> optional.value } .map { optional -> optional.value }
@@ -23,8 +23,8 @@ import io.reactivex.Flowable
import javax.inject.Inject import javax.inject.Inject
class AddScheduledMessage @Inject constructor( class AddScheduledMessage @Inject constructor(
private val scheduledMessageRepo: ScheduledMessageRepository, private val scheduledMessageRepo: ScheduledMessageRepository,
private val updateScheduledMessageAlarms: UpdateScheduledMessageAlarms private val updateScheduledMessageAlarms: UpdateScheduledMessageAlarms
) : Interactor<AddScheduledMessage.Params>() { ) : Interactor<AddScheduledMessage.Params>() {
data class Params(val date: Long, data class Params(val date: Long,
@@ -24,9 +24,9 @@ import io.reactivex.Flowable
import javax.inject.Inject import javax.inject.Inject
class DeleteConversations @Inject constructor( class DeleteConversations @Inject constructor(
private val conversationRepo: ConversationRepository, private val conversationRepo: ConversationRepository,
private val notificationManager: NotificationManager, private val notificationManager: NotificationManager,
private val updateBadge: UpdateBadge private val updateBadge: UpdateBadge
) : Interactor<List<Long>>() { ) : Interactor<List<Long>>() {
override fun buildObservable(params: List<Long>): Flowable<*> { override fun buildObservable(params: List<Long>): Flowable<*> {
@@ -25,10 +25,10 @@ import io.reactivex.Flowable
import javax.inject.Inject import javax.inject.Inject
class DeleteMessages @Inject constructor( class DeleteMessages @Inject constructor(
private val conversationRepo: ConversationRepository, private val conversationRepo: ConversationRepository,
private val messageRepo: MessageRepository, private val messageRepo: MessageRepository,
private val notificationManager: NotificationManager, private val notificationManager: NotificationManager,
private val updateBadge: UpdateBadge private val updateBadge: UpdateBadge
) : Interactor<DeleteMessages.Params>() { ) : Interactor<DeleteMessages.Params>() {
data class Params(val messageIds: List<Long>, val threadId: Long? = null) data class Params(val messageIds: List<Long>, val threadId: Long? = null)
@@ -23,8 +23,8 @@ import io.reactivex.Flowable
import javax.inject.Inject import javax.inject.Inject
class MarkArchived @Inject constructor( class MarkArchived @Inject constructor(
private val conversationRepo: ConversationRepository, private val conversationRepo: ConversationRepository,
private val markRead: MarkRead private val markRead: MarkRead
) : Interactor<List<Long>>() { ) : Interactor<List<Long>>() {
override fun buildObservable(params: List<Long>): Flowable<*> { override fun buildObservable(params: List<Long>): Flowable<*> {
@@ -23,7 +23,7 @@ import io.reactivex.Flowable
import javax.inject.Inject import javax.inject.Inject
class MarkDeliveryFailed @Inject constructor( class MarkDeliveryFailed @Inject constructor(
private val messageRepo: MessageRepository private val messageRepo: MessageRepository
) : Interactor<MarkDeliveryFailed.Params>() { ) : Interactor<MarkDeliveryFailed.Params>() {
data class Params(val id: Long, val resultCode: Int) data class Params(val id: Long, val resultCode: Int)
@@ -24,8 +24,8 @@ import io.reactivex.Flowable
import javax.inject.Inject import javax.inject.Inject
class MarkFailed @Inject constructor( class MarkFailed @Inject constructor(
private val messageRepo: MessageRepository, private val messageRepo: MessageRepository,
private val notificationManager: NotificationManager private val notificationManager: NotificationManager
) : Interactor<MarkFailed.Params>() { ) : Interactor<MarkFailed.Params>() {
data class Params(val id: Long, val resultCode: Int) data class Params(val id: Long, val resultCode: Int)
@@ -25,10 +25,10 @@ import io.reactivex.Flowable
import javax.inject.Inject import javax.inject.Inject
class MarkRead @Inject constructor( class MarkRead @Inject constructor(
private val conversationRepo: ConversationRepository, private val conversationRepo: ConversationRepository,
private val messageRepo: MessageRepository, private val messageRepo: MessageRepository,
private val notificationManager: NotificationManager, private val notificationManager: NotificationManager,
private val updateBadge: UpdateBadge private val updateBadge: UpdateBadge
) : Interactor<List<Long>>() { ) : Interactor<List<Long>>() {
override fun buildObservable(params: List<Long>): Flowable<*> { override fun buildObservable(params: List<Long>): Flowable<*> {
@@ -23,8 +23,8 @@ import io.reactivex.Flowable
import javax.inject.Inject import javax.inject.Inject
class MarkUnread @Inject constructor( class MarkUnread @Inject constructor(
private val messageRepo: MessageRepository, private val messageRepo: MessageRepository,
private val updateBadge: UpdateBadge private val updateBadge: UpdateBadge
) : Interactor<List<Long>>() { ) : Interactor<List<Long>>() {
override fun buildObservable(params: List<Long>): Flowable<*> { override fun buildObservable(params: List<Long>): Flowable<*> {
@@ -23,7 +23,7 @@ import io.reactivex.Flowable
import javax.inject.Inject import javax.inject.Inject
class PerformBackup @Inject constructor( class PerformBackup @Inject constructor(
private val backupRepo: BackupRepository private val backupRepo: BackupRepository
) : Interactor<Unit>() { ) : Interactor<Unit>() {
override fun buildObservable(params: Unit): Flowable<*> { override fun buildObservable(params: Unit): Flowable<*> {
@@ -23,7 +23,7 @@ import io.reactivex.Flowable
import javax.inject.Inject import javax.inject.Inject
class PerformRestore @Inject constructor( class PerformRestore @Inject constructor(
private val backupRepo: BackupRepository private val backupRepo: BackupRepository
) : Interactor<String>() { ) : Interactor<String>() {
override fun buildObservable(params: String): Flowable<*> { override fun buildObservable(params: String): Flowable<*> {
@@ -30,13 +30,13 @@ import io.reactivex.Flowable
import javax.inject.Inject import javax.inject.Inject
class ReceiveMms @Inject constructor( class ReceiveMms @Inject constructor(
private val activeConversationManager: ActiveConversationManager, private val activeConversationManager: ActiveConversationManager,
private val conversationRepo: ConversationRepository, private val conversationRepo: ConversationRepository,
private val externalBlockingManager: ExternalBlockingManager, private val externalBlockingManager: ExternalBlockingManager,
private val syncManager: SyncRepository, private val syncManager: SyncRepository,
private val messageRepo: MessageRepository, private val messageRepo: MessageRepository,
private val notificationManager: NotificationManager, private val notificationManager: NotificationManager,
private val updateBadge: UpdateBadge private val updateBadge: UpdateBadge
) : Interactor<Uri>() { ) : Interactor<Uri>() {
override fun buildObservable(params: Uri): Flowable<*> { override fun buildObservable(params: Uri): Flowable<*> {
@@ -29,12 +29,12 @@ import io.reactivex.Flowable
import javax.inject.Inject import javax.inject.Inject
class ReceiveSms @Inject constructor( class ReceiveSms @Inject constructor(
private val conversationRepo: ConversationRepository, private val conversationRepo: ConversationRepository,
private val externalBlockingManager: ExternalBlockingManager, private val externalBlockingManager: ExternalBlockingManager,
private val messageRepo: MessageRepository, private val messageRepo: MessageRepository,
private val notificationManager: NotificationManager, private val notificationManager: NotificationManager,
private val updateBadge: UpdateBadge, private val updateBadge: UpdateBadge,
private val shortcutManager: ShortcutManager private val shortcutManager: ShortcutManager
) : Interactor<ReceiveSms.Params>() { ) : Interactor<ReceiveSms.Params>() {
class Params(val subId: Int, val messages: Array<SmsMessage>) class Params(val subId: Int, val messages: Array<SmsMessage>)
@@ -24,8 +24,8 @@ import io.reactivex.Flowable
import javax.inject.Inject import javax.inject.Inject
class SaveImage @Inject constructor( class SaveImage @Inject constructor(
private val imageRepository: ImageRepository, private val imageRepository: ImageRepository,
private val messageRepo: MessageRepository private val messageRepo: MessageRepository
) : Interactor<Long>() { ) : Interactor<Long>() {
override fun buildObservable(params: Long): Flowable<*> { override fun buildObservable(params: Long): Flowable<*> {
@@ -26,18 +26,18 @@ import io.reactivex.Flowable
import javax.inject.Inject import javax.inject.Inject
class SendMessage @Inject constructor( class SendMessage @Inject constructor(
private val conversationRepo: ConversationRepository, private val conversationRepo: ConversationRepository,
private val messageRepo: MessageRepository, private val messageRepo: MessageRepository,
private val syncRepo: SyncRepository private val syncRepo: SyncRepository
) : Interactor<SendMessage.Params>() { ) : Interactor<SendMessage.Params>() {
data class Params( data class Params(
val subId: Int, val subId: Int,
val threadId: Long, val threadId: Long,
val addresses: List<String>, val addresses: List<String>,
val body: String, val body: String,
val attachments: List<Attachment> = listOf(), val attachments: List<Attachment> = listOf(),
val delay: Int = 0) val delay: Int = 0)
override fun buildObservable(params: Params): Flowable<*> = Flowable.just(Unit) override fun buildObservable(params: Params): Flowable<*> = Flowable.just(Unit)
.filter { params.addresses.isNotEmpty() } .filter { params.addresses.isNotEmpty() }
@@ -30,9 +30,9 @@ import io.realm.RealmList
import javax.inject.Inject import javax.inject.Inject
class SendScheduledMessage @Inject constructor( class SendScheduledMessage @Inject constructor(
private val context: Context, private val context: Context,
private val scheduledMessageRepo: ScheduledMessageRepository, private val scheduledMessageRepo: ScheduledMessageRepository,
private val sendMessage: SendMessage private val sendMessage: SendMessage
) : Interactor<Long>() { ) : Interactor<Long>() {
override fun buildObservable(params: Long): Flowable<*> { override fun buildObservable(params: Long): Flowable<*> {
@@ -26,9 +26,9 @@ import io.reactivex.Flowable
import javax.inject.Inject import javax.inject.Inject
class SyncMessage @Inject constructor( class SyncMessage @Inject constructor(
private val conversationRepo: ConversationRepository, private val conversationRepo: ConversationRepository,
private val syncManager: SyncRepository, private val syncManager: SyncRepository,
private val updateBadge: UpdateBadge private val updateBadge: UpdateBadge
) : Interactor<Uri>() { ) : Interactor<Uri>() {
override fun buildObservable(params: Uri): Flowable<*> { override fun buildObservable(params: Uri): Flowable<*> {
@@ -25,8 +25,8 @@ import java.util.concurrent.TimeUnit
import javax.inject.Inject import javax.inject.Inject
class SyncMessages @Inject constructor( class SyncMessages @Inject constructor(
private val syncManager: SyncRepository, private val syncManager: SyncRepository,
private val updateBadge: UpdateBadge private val updateBadge: UpdateBadge
) : Interactor<Unit>() { ) : Interactor<Unit>() {
override fun buildObservable(params: Unit): Flowable<*> { override fun buildObservable(params: Unit): Flowable<*> {
@@ -24,8 +24,8 @@ import io.reactivex.Flowable
import javax.inject.Inject import javax.inject.Inject
class UpdateBadge @Inject constructor( class UpdateBadge @Inject constructor(
private val shortcutManager: ShortcutManager, private val shortcutManager: ShortcutManager,
private val widgetManager: WidgetManager private val widgetManager: WidgetManager
) : Interactor<Unit>() { ) : Interactor<Unit>() {
override fun buildObservable(params: Unit): Flowable<*> { override fun buildObservable(params: Unit): Flowable<*> {
@@ -24,9 +24,9 @@ import io.reactivex.Flowable
import javax.inject.Inject import javax.inject.Inject
class UpdateScheduledMessageAlarms @Inject constructor( class UpdateScheduledMessageAlarms @Inject constructor(
private val alarmManager: AlarmManager, private val alarmManager: AlarmManager,
private val scheduledMessageRepo: ScheduledMessageRepository, private val scheduledMessageRepo: ScheduledMessageRepository,
private val sendScheduledMessage: SendScheduledMessage private val sendScheduledMessage: SendScheduledMessage
) : Interactor<Unit>() { ) : Interactor<Unit>() {
override fun buildObservable(params: Unit): Flowable<*> { override fun buildObservable(params: Unit): Flowable<*> {
@@ -19,8 +19,8 @@
package com.moez.QKSMS.model package com.moez.QKSMS.model
data class BackupFile( data class BackupFile(
val path: String, val path: String,
val date: Long, val date: Long,
val messages: Int, val messages: Int,
val size: Long val size: Long
) )
@@ -23,8 +23,8 @@ import io.realm.RealmObject
import io.realm.annotations.PrimaryKey import io.realm.annotations.PrimaryKey
open class Contact( open class Contact(
@PrimaryKey var lookupKey: String = "", @PrimaryKey var lookupKey: String = "",
var numbers: RealmList<PhoneNumber> = RealmList(), var numbers: RealmList<PhoneNumber> = RealmList(),
var name: String = "", var name: String = "",
var lastUpdate: Long = 0 var lastUpdate: Long = 0
) : RealmObject() ) : RealmObject()
@@ -24,20 +24,20 @@ import io.realm.annotations.Index
import io.realm.annotations.PrimaryKey import io.realm.annotations.PrimaryKey
open class Conversation( open class Conversation(
@PrimaryKey var id: Long = 0, @PrimaryKey var id: Long = 0,
@Index var archived: Boolean = false, @Index var archived: Boolean = false,
@Index var blocked: Boolean = false, @Index var blocked: Boolean = false,
@Index var pinned: Boolean = false, @Index var pinned: Boolean = false,
var recipients: RealmList<Recipient> = RealmList(), var recipients: RealmList<Recipient> = RealmList(),
var count: Int = 0, var count: Int = 0,
var date: Long = 0, var date: Long = 0,
var snippet: String = "", var snippet: String = "",
var read: Boolean = true, var read: Boolean = true,
var me: Boolean = false, var me: Boolean = false,
var draft: String = "", var draft: String = "",
// For group chats, the user is allowed to set a custom title for the conversation // For group chats, the user is allowed to set a custom title for the conversation
var name: String = "" var name: String = ""
) : RealmObject() { ) : RealmObject() {
fun getTitle(): String { fun getTitle(): String {
@@ -21,6 +21,6 @@ package com.moez.QKSMS.model
import io.realm.RealmObject import io.realm.RealmObject
open class PhoneNumber( open class PhoneNumber(
var address: String = "", var address: String = "",
var type: String = "" var type: String = ""
) : RealmObject() ) : RealmObject()
@@ -24,10 +24,10 @@ import io.realm.annotations.PrimaryKey
import java.util.* import java.util.*
open class Recipient( open class Recipient(
@PrimaryKey var id: Long = 0, @PrimaryKey var id: Long = 0,
var address: String = "", var address: String = "",
var contact: Contact? = null, var contact: Contact? = null,
var lastUpdate: Long = 0 var lastUpdate: Long = 0
) : RealmObject() { ) : RealmObject() {
/** /**
@@ -23,13 +23,13 @@ import io.realm.RealmObject
import io.realm.annotations.PrimaryKey import io.realm.annotations.PrimaryKey
open class ScheduledMessage( open class ScheduledMessage(
@PrimaryKey var id: Long = 0, @PrimaryKey var id: Long = 0,
var date: Long = 0, var date: Long = 0,
var subId: Int = -1, var subId: Int = -1,
var recipients: RealmList<String> = RealmList(), var recipients: RealmList<String> = RealmList(),
var sendAsGroup: Boolean = true, var sendAsGroup: Boolean = true,
var body: String = "", var body: String = "",
var attachments: RealmList<String> = RealmList() var attachments: RealmList<String> = RealmList()
) : RealmObject() { ) : RealmObject() {
fun copy(id: Long = this.id, fun copy(id: Long = this.id,
@@ -45,10 +45,10 @@ import javax.inject.Singleton
@Singleton @Singleton
class Navigator @Inject constructor( class Navigator @Inject constructor(
private val context: Context, private val context: Context,
private val analyticsManager: AnalyticsManager, private val analyticsManager: AnalyticsManager,
private val notificationManager: NotificationManager, private val notificationManager: NotificationManager,
private val permissions: PermissionManager private val permissions: PermissionManager
) { ) {
private fun startActivity(intent: Intent) { private fun startActivity(intent: Intent) {
@@ -37,8 +37,8 @@ inline fun LifecycleOwner.scope(): LifecycleScopeProvider<*> = AndroidLifecycleS
* @param untilEvent the event until the scope is valid. * @param untilEvent the event until the scope is valid.
*/ */
@CheckReturnValue @CheckReturnValue
inline fun LifecycleOwner.scope(untilEvent: Lifecycle.Event): LifecycleScopeProvider<*> inline fun LifecycleOwner.scope(untilEvent: Lifecycle.Event): LifecycleScopeProvider<*> =
= AndroidLifecycleScopeProvider.from(this, untilEvent) AndroidLifecycleScopeProvider.from(this, untilEvent)
/** /**
* Extension that returns a [LifecycleScopeProvider] for this [LifecycleOwner]. * Extension that returns a [LifecycleScopeProvider] for this [LifecycleOwner].
@@ -46,8 +46,8 @@ inline fun LifecycleOwner.scope(untilEvent: Lifecycle.Event): LifecycleScopeProv
* @param boundaryResolver function that resolves the event boundary. * @param boundaryResolver function that resolves the event boundary.
*/ */
@CheckReturnValue @CheckReturnValue
inline fun LifecycleOwner.scope(boundaryResolver: Function<Event, Event>): LifecycleScopeProvider<*> inline fun LifecycleOwner.scope(boundaryResolver: Function<Event, Event>): LifecycleScopeProvider<*> =
= AndroidLifecycleScopeProvider.from(this, boundaryResolver) AndroidLifecycleScopeProvider.from(this, boundaryResolver)
/** /**
* Extension that returns a [LifecycleScopeProvider] for this [Lifecycle]. * Extension that returns a [LifecycleScopeProvider] for this [Lifecycle].
@@ -61,8 +61,8 @@ inline fun Lifecycle.scope(): LifecycleScopeProvider<*> = AndroidLifecycleScopeP
* @param untilEvent the event until the scope is valid. * @param untilEvent the event until the scope is valid.
*/ */
@CheckReturnValue @CheckReturnValue
inline fun Lifecycle.scope(untilEvent: Lifecycle.Event): LifecycleScopeProvider<*> inline fun Lifecycle.scope(untilEvent: Lifecycle.Event): LifecycleScopeProvider<*> =
= AndroidLifecycleScopeProvider.from(this, untilEvent) AndroidLifecycleScopeProvider.from(this, untilEvent)
/** /**
* Extension that returns a [LifecycleScopeProvider] for this [Lifecycle]. * Extension that returns a [LifecycleScopeProvider] for this [Lifecycle].
@@ -70,5 +70,5 @@ inline fun Lifecycle.scope(untilEvent: Lifecycle.Event): LifecycleScopeProvider<
* @param boundaryResolver function that resolves the event boundary. * @param boundaryResolver function that resolves the event boundary.
*/ */
@CheckReturnValue @CheckReturnValue
inline fun Lifecycle.scope(boundaryResolver: Function<Event, Event>): LifecycleScopeProvider<*> inline fun Lifecycle.scope(boundaryResolver: Function<Event, Event>): LifecycleScopeProvider<*> =
= AndroidLifecycleScopeProvider.from(this, boundaryResolver) AndroidLifecycleScopeProvider.from(this, boundaryResolver)
@@ -42,8 +42,8 @@ import javax.inject.Singleton
@Singleton @Singleton
class BillingManager @Inject constructor( class BillingManager @Inject constructor(
context: Context, context: Context,
private val analyticsManager: AnalyticsManager private val analyticsManager: AnalyticsManager
) : PurchasesUpdatedListener { ) : PurchasesUpdatedListener {
companion object { companion object {
@@ -28,8 +28,8 @@ import com.moez.QKSMS.util.tryOrNull
import javax.inject.Inject import javax.inject.Inject
class MessageDetailsFormatter @Inject constructor( class MessageDetailsFormatter @Inject constructor(
private val context: Context, private val context: Context,
private val dateFormatter: DateFormatter private val dateFormatter: DateFormatter
) { ) {
fun format(message: Message): String { fun format(message: Message): String {
@@ -54,12 +54,12 @@ import javax.inject.Singleton
@Singleton @Singleton
class NotificationManagerImpl @Inject constructor( class NotificationManagerImpl @Inject constructor(
private val context: Context, private val context: Context,
private val colors: Colors, private val colors: Colors,
private val conversationRepo: ConversationRepository, private val conversationRepo: ConversationRepository,
private val prefs: Preferences, private val prefs: Preferences,
private val messageRepo: MessageRepository, private val messageRepo: MessageRepository,
private val permissions: PermissionManager private val permissions: PermissionManager
) : com.moez.QKSMS.manager.NotificationManager { ) : com.moez.QKSMS.manager.NotificationManager {
companion object { companion object {
@@ -37,9 +37,9 @@ import me.leolin.shortcutbadger.ShortcutBadger
import javax.inject.Inject import javax.inject.Inject
class ShortcutManagerImpl @Inject constructor( class ShortcutManagerImpl @Inject constructor(
private val context: Context, private val context: Context,
private val conversationRepo: ConversationRepository, private val conversationRepo: ConversationRepository,
private val messageRepo: MessageRepository private val messageRepo: MessageRepository
) : com.moez.QKSMS.manager.ShortcutManager { ) : com.moez.QKSMS.manager.ShortcutManager {
override fun updateBadge() { override fun updateBadge() {
@@ -34,9 +34,9 @@ import com.moez.QKSMS.util.Preferences
import javax.inject.Inject import javax.inject.Inject
class TextViewStyler @Inject constructor( class TextViewStyler @Inject constructor(
private val prefs: Preferences, private val prefs: Preferences,
private val colors: Colors, private val colors: Colors,
private val fontProvider: FontProvider private val fontProvider: FontProvider
) { ) {
companion object { companion object {
@@ -33,8 +33,8 @@ import kotlinx.android.synthetic.main.backup_list_item.view.*
import javax.inject.Inject import javax.inject.Inject
class BackupAdapter @Inject constructor( class BackupAdapter @Inject constructor(
private val context: Context, private val context: Context,
private val dateFormatter: DateFormatter private val dateFormatter: DateFormatter
) : FlowableAdapter<BackupFile>() { ) : FlowableAdapter<BackupFile>() {
val backupSelected: Subject<BackupFile> = PublishSubject.create() val backupSelected: Subject<BackupFile> = PublishSubject.create()
@@ -37,13 +37,13 @@ import java.util.concurrent.TimeUnit
import javax.inject.Inject import javax.inject.Inject
class BackupPresenter @Inject constructor( class BackupPresenter @Inject constructor(
private val backupRepo: BackupRepository, private val backupRepo: BackupRepository,
private val billingManager: BillingManager, private val billingManager: BillingManager,
private val context: Context, private val context: Context,
private val dateFormatter: DateFormatter, private val dateFormatter: DateFormatter,
private val navigator: Navigator, private val navigator: Navigator,
private val performBackup: PerformBackup, private val performBackup: PerformBackup,
private val permissionManager: PermissionManager private val permissionManager: PermissionManager
) : QkPresenter<BackupView, BackupState>(BackupState()) { ) : QkPresenter<BackupView, BackupState>(BackupState()) {
private val storagePermissionSubject: Subject<Boolean> = BehaviorSubject.createDefault(permissionManager.hasStorage()) private val storagePermissionSubject: Subject<Boolean> = BehaviorSubject.createDefault(permissionManager.hasStorage())
@@ -22,9 +22,9 @@ import com.moez.QKSMS.model.BackupFile
import com.moez.QKSMS.repository.BackupRepository import com.moez.QKSMS.repository.BackupRepository
data class BackupState( data class BackupState(
val backupProgress: BackupRepository.Progress = BackupRepository.Progress.Idle(), val backupProgress: BackupRepository.Progress = BackupRepository.Progress.Idle(),
val restoreProgress: BackupRepository.Progress = BackupRepository.Progress.Idle(), val restoreProgress: BackupRepository.Progress = BackupRepository.Progress.Idle(),
val lastBackup: String = "", val lastBackup: String = "",
val backups: List<BackupFile> = listOf(), val backups: List<BackupFile> = listOf(),
val upgraded: Boolean = false val upgraded: Boolean = false
) )
@@ -22,6 +22,6 @@ import com.moez.QKSMS.model.Conversation
import io.realm.RealmResults import io.realm.RealmResults
data class BlockedState( data class BlockedState(
val siaEnabled: Boolean = false, val siaEnabled: Boolean = false,
val data: RealmResults<Conversation>? = null val data: RealmResults<Conversation>? = null
) )
@@ -33,12 +33,12 @@ import io.reactivex.rxkotlin.withLatestFrom
import javax.inject.Inject import javax.inject.Inject
class BlockedViewModel @Inject constructor( class BlockedViewModel @Inject constructor(
private val context: Context, private val context: Context,
private val analytics: AnalyticsManager, private val analytics: AnalyticsManager,
private val conversationRepo: ConversationRepository, private val conversationRepo: ConversationRepository,
private val markUnblocked: MarkUnblocked, private val markUnblocked: MarkUnblocked,
private val navigator: Navigator, private val navigator: Navigator,
private val prefs: Preferences private val prefs: Preferences
) : QkViewModel<BlockedView, BlockedState>(BlockedState()) { ) : QkViewModel<BlockedView, BlockedState>(BlockedState()) {
init { init {
@@ -32,7 +32,7 @@ import kotlinx.android.synthetic.main.attachment_list_item.view.*
import javax.inject.Inject import javax.inject.Inject
class AttachmentAdapter @Inject constructor( class AttachmentAdapter @Inject constructor(
private val context: Context private val context: Context
) : QkAdapter<Attachment>() { ) : QkAdapter<Attachment>() {
val attachmentDeleted: Subject<Attachment> = PublishSubject.create() val attachmentDeleted: Subject<Attachment> = PublishSubject.create()
@@ -26,25 +26,25 @@ import com.moez.QKSMS.model.Message
import io.realm.RealmResults import io.realm.RealmResults
data class ComposeState( data class ComposeState(
val hasError: Boolean = false, val hasError: Boolean = false,
val editingMode: Boolean = false, val editingMode: Boolean = false,
val contacts: List<Contact> = ArrayList(), val contacts: List<Contact> = ArrayList(),
val contactsVisible: Boolean = false, val contactsVisible: Boolean = false,
val selectedConversation: Long = 0, val selectedConversation: Long = 0,
val selectedContacts: List<Contact> = ArrayList(), val selectedContacts: List<Contact> = ArrayList(),
val sendAsGroup: Boolean = true, val sendAsGroup: Boolean = true,
val conversationtitle: String = "", val conversationtitle: String = "",
val loading: Boolean = false, val loading: Boolean = false,
val query: String = "", val query: String = "",
val searchSelectionId: Long = -1, val searchSelectionId: Long = -1,
val searchSelectionPosition: Int = 0, val searchSelectionPosition: Int = 0,
val searchResults: Int = 0, val searchResults: Int = 0,
val messages: Pair<Conversation, RealmResults<Message>>? = null, val messages: Pair<Conversation, RealmResults<Message>>? = null,
val selectedMessages: Int = 0, val selectedMessages: Int = 0,
val scheduled: Long = 0, val scheduled: Long = 0,
val attachments: List<Attachment> = ArrayList(), val attachments: List<Attachment> = ArrayList(),
val attaching: Boolean = false, val attaching: Boolean = false,
val remaining: String = "", val remaining: String = "",
val subscription: SubscriptionInfoCompat? = null, val subscription: SubscriptionInfoCompat? = null,
val canSend: Boolean = false val canSend: Boolean = false
) )
@@ -73,30 +73,30 @@ import javax.inject.Inject
import javax.inject.Named import javax.inject.Named
class ComposeViewModel @Inject constructor( class ComposeViewModel @Inject constructor(
@Named("query") private val query: String, @Named("query") private val query: String,
@Named("threadId") private val threadId: Long, @Named("threadId") private val threadId: Long,
@Named("address") private val address: String, @Named("address") private val address: String,
@Named("text") private val sharedText: String, @Named("text") private val sharedText: String,
@Named("attachments") private val sharedAttachments: List<Attachment>, @Named("attachments") private val sharedAttachments: List<Attachment>,
private val context: Context, private val context: Context,
private val activeConversationManager: ActiveConversationManager, private val activeConversationManager: ActiveConversationManager,
private val addScheduledMessage: AddScheduledMessage, private val addScheduledMessage: AddScheduledMessage,
private val billingManager: BillingManager, private val billingManager: BillingManager,
private val cancelMessage: CancelDelayedMessage, private val cancelMessage: CancelDelayedMessage,
private val contactFilter: ContactFilter, private val contactFilter: ContactFilter,
private val contactsRepo: ContactRepository, private val contactsRepo: ContactRepository,
private val conversationRepo: ConversationRepository, private val conversationRepo: ConversationRepository,
private val deleteMessages: DeleteMessages, private val deleteMessages: DeleteMessages,
private val markRead: MarkRead, private val markRead: MarkRead,
private val messageDetailsFormatter: MessageDetailsFormatter, private val messageDetailsFormatter: MessageDetailsFormatter,
private val messageRepo: MessageRepository, private val messageRepo: MessageRepository,
private val navigator: Navigator, private val navigator: Navigator,
private val permissionManager: PermissionManager, private val permissionManager: PermissionManager,
private val prefs: Preferences, private val prefs: Preferences,
private val retrySending: RetrySending, private val retrySending: RetrySending,
private val sendMessage: SendMessage, private val sendMessage: SendMessage,
private val subscriptionManager: SubscriptionManagerCompat, private val subscriptionManager: SubscriptionManagerCompat,
private val syncContacts: ContactSync private val syncContacts: ContactSync
) : QkViewModel<ComposeView, ComposeState>(ComposeState( ) : QkViewModel<ComposeView, ComposeState>(ComposeState(
editingMode = threadId == 0L && address.isBlank(), editingMode = threadId == 0L && address.isBlank(),
selectedConversation = threadId, selectedConversation = threadId,
@@ -64,12 +64,12 @@ import java.util.concurrent.TimeUnit
import javax.inject.Inject import javax.inject.Inject
class MessagesAdapter @Inject constructor( class MessagesAdapter @Inject constructor(
private val context: Context, private val context: Context,
private val colors: Colors, private val colors: Colors,
private val dateFormatter: DateFormatter, private val dateFormatter: DateFormatter,
private val navigator: Navigator, private val navigator: Navigator,
private val prefs: Preferences, private val prefs: Preferences,
private val subscriptionManager: SubscriptionManagerCompat private val subscriptionManager: SubscriptionManagerCompat
) : QkRealmAdapter<Message>() { ) : QkRealmAdapter<Message>() {
companion object { companion object {
@@ -28,7 +28,7 @@ import com.moez.QKSMS.model.PhoneNumber
import kotlinx.android.synthetic.main.contact_list_item.view.* import kotlinx.android.synthetic.main.contact_list_item.view.*
class PhoneNumberAdapter( class PhoneNumberAdapter(
private val numberClicked: (Contact, Int) -> Unit private val numberClicked: (Contact, Int) -> Unit
) : QkAdapter<PhoneNumber>() { ) : QkAdapter<PhoneNumber>() {
lateinit var contact: Contact lateinit var contact: Contact
@@ -40,9 +40,9 @@ import io.reactivex.schedulers.Schedulers
import kotlinx.android.synthetic.main.mms_vcard_list_item.view.* import kotlinx.android.synthetic.main.mms_vcard_list_item.view.*
class VCardBinder( class VCardBinder(
private val context: Context, private val context: Context,
private val navigator: Navigator, private val navigator: Navigator,
private val theme: Colors.Theme private val theme: Colors.Theme
) : PartBinder { ) : PartBinder {
override val partLayout = R.layout.mms_vcard_list_item override val partLayout = R.layout.mms_vcard_list_item
@@ -38,15 +38,15 @@ import javax.inject.Inject
import javax.inject.Named import javax.inject.Named
class ConversationInfoPresenter @Inject constructor( class ConversationInfoPresenter @Inject constructor(
@Named("threadId") threadId: Long, @Named("threadId") threadId: Long,
messageRepo: MessageRepository, messageRepo: MessageRepository,
private val conversationRepo: ConversationRepository, private val conversationRepo: ConversationRepository,
private val deleteConversations: DeleteConversations, private val deleteConversations: DeleteConversations,
private val markArchived: MarkArchived, private val markArchived: MarkArchived,
private val markUnarchived: MarkUnarchived, private val markUnarchived: MarkUnarchived,
private val markBlocked: MarkBlocked, private val markBlocked: MarkBlocked,
private val markUnblocked: MarkUnblocked, private val markUnblocked: MarkUnblocked,
private val navigator: Navigator private val navigator: Navigator
) : QkPresenter<ConversationInfoView, ConversationInfoState>( ) : QkPresenter<ConversationInfoView, ConversationInfoState>(
ConversationInfoState(threadId = threadId, media = messageRepo.getPartsForConversation(threadId)) ConversationInfoState(threadId = threadId, media = messageRepo.getPartsForConversation(threadId))
) { ) {
@@ -24,11 +24,11 @@ import io.realm.RealmList
import io.realm.RealmResults import io.realm.RealmResults
data class ConversationInfoState( data class ConversationInfoState(
val name: String = "", val name: String = "",
val recipients: RealmList<Recipient>? = null, val recipients: RealmList<Recipient>? = null,
val threadId: Long = 0, val threadId: Long = 0,
val archived: Boolean = false, val archived: Boolean = false,
val blocked: Boolean = false, val blocked: Boolean = false,
val media: RealmResults<MmsPart>? = null, val media: RealmResults<MmsPart>? = null,
val hasError: Boolean = false val hasError: Boolean = false
) )
@@ -33,8 +33,8 @@ import kotlinx.android.synthetic.main.conversation_media_list_item.view.*
import javax.inject.Inject import javax.inject.Inject
class ConversationMediaAdapter @Inject constructor( class ConversationMediaAdapter @Inject constructor(
private val context: Context, private val context: Context,
private val navigator: Navigator private val navigator: Navigator
) : QkRealmAdapter<MmsPart>() { ) : QkRealmAdapter<MmsPart>() {
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): QkViewHolder { override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): QkViewHolder {
@@ -32,7 +32,7 @@ import kotlinx.android.synthetic.main.conversation_recipient_list_item.view.*
import javax.inject.Inject import javax.inject.Inject
class ConversationRecipientAdapter @Inject constructor( class ConversationRecipientAdapter @Inject constructor(
private val navigator: Navigator private val navigator: Navigator
) : QkRealmAdapter<Recipient>() { ) : QkRealmAdapter<Recipient>() {
var threadId: Long = 0L var threadId: Long = 0L
@@ -42,10 +42,10 @@ import javax.inject.Inject
class ConversationItemTouchCallback @Inject constructor( class ConversationItemTouchCallback @Inject constructor(
colors: Colors, colors: Colors,
disposables: CompositeDisposable, disposables: CompositeDisposable,
prefs: Preferences, prefs: Preferences,
private val context: Context private val context: Context
) : ItemTouchHelper.SimpleCallback(0, 0) { ) : ItemTouchHelper.SimpleCallback(0, 0) {
val swipes: Subject<Pair<Long, Int>> = PublishSubject.create() val swipes: Subject<Pair<Long, Int>> = PublishSubject.create()
@@ -34,9 +34,9 @@ import kotlinx.android.synthetic.main.conversation_list_item.view.*
import javax.inject.Inject import javax.inject.Inject
class ConversationsAdapter @Inject constructor( class ConversationsAdapter @Inject constructor(
private val context: Context, private val context: Context,
private val dateFormatter: DateFormatter, private val dateFormatter: DateFormatter,
private val navigator: Navigator private val navigator: Navigator
) : QkRealmAdapter<Conversation>() { ) : QkRealmAdapter<Conversation>() {
init { init {
@@ -48,9 +48,9 @@ import javax.inject.Inject
import javax.inject.Named import javax.inject.Named
class GalleryPagerAdapter @Inject constructor( class GalleryPagerAdapter @Inject constructor(
context: Context, context: Context,
@Named("partId") private val partId: Long, @Named("partId") private val partId: Long,
private val dateFormatter: DateFormatter private val dateFormatter: DateFormatter
) : PagerAdapter() { ) : PagerAdapter() {
var parts: RealmResults<MmsPart>? = null var parts: RealmResults<MmsPart>? = null
@@ -22,6 +22,7 @@ import com.moez.QKSMS.model.MmsPart
import io.realm.RealmResults import io.realm.RealmResults
data class GalleryState( data class GalleryState(
val navigationVisible: Boolean = true, val navigationVisible: Boolean = true,
val title: String? = "", val title: String? = "",
val parts: RealmResults<MmsPart>? = null) val parts: RealmResults<MmsPart>? = null
)
@@ -35,11 +35,11 @@ import javax.inject.Inject
import javax.inject.Named import javax.inject.Named
class GalleryViewModel @Inject constructor( class GalleryViewModel @Inject constructor(
conversationRepo: ConversationRepository, conversationRepo: ConversationRepository,
messageRepo: MessageRepository, messageRepo: MessageRepository,
@Named("partId") private val partId: Long, @Named("partId") private val partId: Long,
private val context: Context, private val context: Context,
private val saveImage: SaveImage private val saveImage: SaveImage
) : QkViewModel<GalleryView, GalleryState>(GalleryState()) { ) : QkViewModel<GalleryView, GalleryState>(GalleryState()) {
init { init {
@@ -25,8 +25,8 @@ import com.moez.QKSMS.manager.AnalyticsManager
import javax.inject.Inject import javax.inject.Inject
class DrawerBadgesExperiment @Inject constructor( class DrawerBadgesExperiment @Inject constructor(
context: Context, context: Context,
analyticsManager: AnalyticsManager analyticsManager: AnalyticsManager
) : Experiment<Boolean>(context, analyticsManager) { ) : Experiment<Boolean>(context, analyticsManager) {
override val key: String = "Drawer Badges" override val key: String = "Drawer Badges"
@@ -24,32 +24,34 @@ import com.moez.QKSMS.repository.SyncRepository
import io.realm.RealmResults import io.realm.RealmResults
data class MainState( data class MainState(
val hasError: Boolean = false, val hasError: Boolean = false,
val page: MainPage = Inbox(), val page: MainPage = Inbox(),
val drawerOpen: Boolean = false, val drawerOpen: Boolean = false,
val upgraded: Boolean = true, val upgraded: Boolean = true,
val showRating: Boolean = false, val showRating: Boolean = false,
val syncing: SyncRepository.SyncProgress = SyncRepository.SyncProgress.Idle(), val syncing: SyncRepository.SyncProgress = SyncRepository.SyncProgress.Idle(),
val defaultSms: Boolean = true, val defaultSms: Boolean = true,
val smsPermission: Boolean = true, val smsPermission: Boolean = true,
val contactPermission: Boolean = true val contactPermission: Boolean = true
) )
sealed class MainPage sealed class MainPage
data class Inbox( data class Inbox(
val markPinned: Boolean = true, val markPinned: Boolean = true,
val markRead: Boolean = false, val markRead: Boolean = false,
val data: RealmResults<Conversation>? = null, val data: RealmResults<Conversation>? = null,
val selected: Int = 0) : MainPage() val selected: Int = 0
) : MainPage()
data class Searching( data class Searching(
val loading: Boolean = false, val loading: Boolean = false,
val data: List<SearchResult>? = null val data: List<SearchResult>? = null
) : MainPage() ) : MainPage()
data class Archived( data class Archived(
val markPinned: Boolean = true, val markPinned: Boolean = true,
val markRead: Boolean = false, val markRead: Boolean = false,
val data: RealmResults<Conversation>? = null, val data: RealmResults<Conversation>? = null,
val selected: Int = 0) : MainPage() val selected: Int = 0
) : MainPage()
@@ -53,24 +53,24 @@ import java.util.concurrent.TimeUnit
import javax.inject.Inject import javax.inject.Inject
class MainViewModel @Inject constructor( class MainViewModel @Inject constructor(
billingManager: BillingManager, billingManager: BillingManager,
markAllSeen: MarkAllSeen, markAllSeen: MarkAllSeen,
migratePreferences: MigratePreferences, migratePreferences: MigratePreferences,
syncRepository: SyncRepository, syncRepository: SyncRepository,
private val conversationRepo: ConversationRepository, private val conversationRepo: ConversationRepository,
private val deleteConversations: DeleteConversations, private val deleteConversations: DeleteConversations,
private val markArchived: MarkArchived, private val markArchived: MarkArchived,
private val markBlocked: MarkBlocked, private val markBlocked: MarkBlocked,
private val markPinned: MarkPinned, private val markPinned: MarkPinned,
private val markRead: MarkRead, private val markRead: MarkRead,
private val markUnarchived: MarkUnarchived, private val markUnarchived: MarkUnarchived,
private val markUnpinned: MarkUnpinned, private val markUnpinned: MarkUnpinned,
private val markUnread: MarkUnread, private val markUnread: MarkUnread,
private val navigator: Navigator, private val navigator: Navigator,
private val permissionManager: PermissionManager, private val permissionManager: PermissionManager,
private val prefs: Preferences, private val prefs: Preferences,
private val ratingManager: RatingManager, private val ratingManager: RatingManager,
private val syncMessages: SyncMessages private val syncMessages: SyncMessages
) : QkViewModel<MainView, MainState>(MainState(page = Inbox(data = conversationRepo.getConversations()))) { ) : QkViewModel<MainView, MainState>(MainState(page = Inbox(data = conversationRepo.getConversations()))) {
init { init {
@@ -36,10 +36,10 @@ import kotlinx.android.synthetic.main.search_list_item.view.*
import javax.inject.Inject import javax.inject.Inject
class SearchAdapter @Inject constructor( class SearchAdapter @Inject constructor(
colors: Colors, colors: Colors,
private val context: Context, private val context: Context,
private val dateFormatter: DateFormatter, private val dateFormatter: DateFormatter,
private val navigator: Navigator private val navigator: Navigator
) : QkAdapter<SearchResult>() { ) : QkAdapter<SearchResult>() {
private val highlightColor: Int by lazy { colors.theme().highlight } private val highlightColor: Int by lazy { colors.theme().highlight }
@@ -22,15 +22,16 @@ import android.os.Build
import com.moez.QKSMS.util.Preferences import com.moez.QKSMS.util.Preferences
data class NotificationPrefsState( data class NotificationPrefsState(
val threadId: Long = 0, val threadId: Long = 0,
val conversationTitle: String = "", val conversationTitle: String = "",
val notificationsEnabled: Boolean = true, val notificationsEnabled: Boolean = true,
val previewSummary: String = "", val previewSummary: String = "",
val previewId: Int = Preferences.NOTIFICATION_PREVIEWS_ALL, val previewId: Int = Preferences.NOTIFICATION_PREVIEWS_ALL,
val action1Summary: String = "", val action1Summary: String = "",
val action2Summary: String = "", val action2Summary: String = "",
val action3Summary: String = "", val action3Summary: String = "",
val vibrationEnabled: Boolean = true, val vibrationEnabled: Boolean = true,
val ringtoneName: String = "", val ringtoneName: String = "",
val qkReplyEnabled: Boolean = Build.VERSION.SDK_INT < Build.VERSION_CODES.N, val qkReplyEnabled: Boolean = Build.VERSION.SDK_INT < Build.VERSION_CODES.N,
val qkReplyTapDismiss: Boolean = true) val qkReplyTapDismiss: Boolean = true
)
@@ -37,11 +37,11 @@ import javax.inject.Inject
import javax.inject.Named import javax.inject.Named
class NotificationPrefsViewModel @Inject constructor( class NotificationPrefsViewModel @Inject constructor(
@Named("threadId") private val threadId: Long, @Named("threadId") private val threadId: Long,
private val context: Context, private val context: Context,
private val conversationRepo: ConversationRepository, private val conversationRepo: ConversationRepository,
private val navigator: Navigator, private val navigator: Navigator,
private val prefs: Preferences private val prefs: Preferences
) : QkViewModel<NotificationPrefsView, NotificationPrefsState>(NotificationPrefsState(threadId = threadId)) { ) : QkViewModel<NotificationPrefsView, NotificationPrefsState>(NotificationPrefsState(threadId = threadId)) {
private val notifications = prefs.notifications(threadId) private val notifications = prefs.notifications(threadId)
@@ -19,8 +19,8 @@
package com.moez.QKSMS.feature.plus package com.moez.QKSMS.feature.plus
data class PlusState( data class PlusState(
val upgraded: Boolean = false, val upgraded: Boolean = false,
val upgradePrice: String = "", val upgradePrice: String = "",
val upgradeDonatePrice: String = "", val upgradeDonatePrice: String = "",
val currency: String = "" val currency: String = ""
) )
@@ -29,9 +29,9 @@ import io.reactivex.rxkotlin.plusAssign
import javax.inject.Inject import javax.inject.Inject
class PlusViewModel @Inject constructor( class PlusViewModel @Inject constructor(
private val analyticsManager: AnalyticsManager, private val analyticsManager: AnalyticsManager,
private val billingManager: BillingManager, private val billingManager: BillingManager,
private val navigator: Navigator private val navigator: Navigator
) : QkViewModel<PlusView, PlusState>(PlusState()) { ) : QkViewModel<PlusView, PlusState>(PlusState()) {
init { init {
@@ -27,8 +27,8 @@ import com.moez.QKSMS.manager.AnalyticsManager
import javax.inject.Inject import javax.inject.Inject
class UpgradeButtonExperiment @Inject constructor( class UpgradeButtonExperiment @Inject constructor(
context: Context, context: Context,
analytics: AnalyticsManager analytics: AnalyticsManager
) : Experiment<@StringRes Int>(context, analytics) { ) : Experiment<@StringRes Int>(context, analytics) {
override val key: String = "Upgrade Button" override val key: String = "Upgrade Button"
@@ -24,12 +24,12 @@ import com.moez.QKSMS.model.Message
import io.realm.RealmResults import io.realm.RealmResults
data class QkReplyState( data class QkReplyState(
val hasError: Boolean = false, val hasError: Boolean = false,
val selectedConversation: Long = 0, val selectedConversation: Long = 0,
val title: String = "", val title: String = "",
val expanded: Boolean = false, val expanded: Boolean = false,
val data: Pair<Conversation, RealmResults<Message>>? = null, val data: Pair<Conversation, RealmResults<Message>>? = null,
val remaining: String = "", val remaining: String = "",
val subscription: SubscriptionInfoCompat? = null, val subscription: SubscriptionInfoCompat? = null,
val canSend: Boolean = false val canSend: Boolean = false
) )
@@ -46,14 +46,14 @@ import javax.inject.Inject
import javax.inject.Named import javax.inject.Named
class QkReplyViewModel @Inject constructor( class QkReplyViewModel @Inject constructor(
@Named("threadId") private val threadId: Long, @Named("threadId") private val threadId: Long,
private val conversationRepo: ConversationRepository, private val conversationRepo: ConversationRepository,
private val deleteMessages: DeleteMessages, private val deleteMessages: DeleteMessages,
private val markRead: MarkRead, private val markRead: MarkRead,
private val messageRepo: MessageRepository, private val messageRepo: MessageRepository,
private val navigator: Navigator, private val navigator: Navigator,
private val sendMessage: SendMessage, private val sendMessage: SendMessage,
private val subscriptionManager: SubscriptionManagerCompat private val subscriptionManager: SubscriptionManagerCompat
) : QkViewModel<QkReplyView, QkReplyState>(QkReplyState(selectedConversation = threadId)) { ) : QkViewModel<QkReplyView, QkReplyState>(QkReplyState(selectedConversation = threadId)) {
private val conversation by lazy { private val conversation by lazy {
@@ -38,8 +38,8 @@ import kotlinx.android.synthetic.main.scheduled_message_list_item.view.*
import javax.inject.Inject import javax.inject.Inject
class ScheduledMessageAdapter @Inject constructor( class ScheduledMessageAdapter @Inject constructor(
private val contactRepo: ContactRepository, private val contactRepo: ContactRepository,
private val dateFormatter: DateFormatter private val dateFormatter: DateFormatter
) : QkRealmAdapter<ScheduledMessage>() { ) : QkRealmAdapter<ScheduledMessage>() {
private val contacts by lazy { contactRepo.getContacts() } private val contacts by lazy { contactRepo.getContacts() }
@@ -22,6 +22,6 @@ import com.moez.QKSMS.model.ScheduledMessage
import io.realm.RealmResults import io.realm.RealmResults
data class ScheduledState( data class ScheduledState(
val scheduledMessages: RealmResults<ScheduledMessage>? = null, val scheduledMessages: RealmResults<ScheduledMessage>? = null,
val upgraded: Boolean = false val upgraded: Boolean = false
) )
@@ -30,10 +30,10 @@ import io.reactivex.rxkotlin.withLatestFrom
import javax.inject.Inject import javax.inject.Inject
class ScheduledViewModel @Inject constructor( class ScheduledViewModel @Inject constructor(
billingManager: BillingManager, billingManager: BillingManager,
private val navigator: Navigator, private val navigator: Navigator,
private val scheduledMessageRepo: ScheduledMessageRepository, private val scheduledMessageRepo: ScheduledMessageRepository,
private val sendScheduledMessage: SendScheduledMessage private val sendScheduledMessage: SendScheduledMessage
) : QkViewModel<ScheduledView, ScheduledState>(ScheduledState( ) : QkViewModel<ScheduledView, ScheduledState>(ScheduledState(
scheduledMessages = scheduledMessageRepo.getScheduledMessages() scheduledMessages = scheduledMessageRepo.getScheduledMessages()
)) { )) {
@@ -39,15 +39,15 @@ import java.util.concurrent.TimeUnit
import javax.inject.Inject import javax.inject.Inject
class SettingsPresenter @Inject constructor( class SettingsPresenter @Inject constructor(
private val context: Context, private val context: Context,
private val billingManager: BillingManager, private val billingManager: BillingManager,
private val colors: Colors, private val colors: Colors,
private val dateFormatter: DateFormatter, private val dateFormatter: DateFormatter,
private val navigator: Navigator, private val navigator: Navigator,
private val nightModeManager: NightModeManager, private val nightModeManager: NightModeManager,
private val prefs: Preferences, private val prefs: Preferences,
private val syncMessages: SyncMessages, private val syncMessages: SyncMessages,
private val syncRepo: SyncRepository private val syncRepo: SyncRepository
) : QkPresenter<SettingsView, SettingsState>(SettingsState(theme = colors.theme().theme)) { ) : QkPresenter<SettingsView, SettingsState>(SettingsState(theme = colors.theme().theme)) {
init { init {
@@ -22,24 +22,24 @@ import com.moez.QKSMS.repository.SyncRepository
import com.moez.QKSMS.util.Preferences import com.moez.QKSMS.util.Preferences
data class SettingsState( data class SettingsState(
val theme: Int = 0, val theme: Int = 0,
val nightModeSummary: String = "", val nightModeSummary: String = "",
val nightModeId: Int = Preferences.NIGHT_MODE_OFF, val nightModeId: Int = Preferences.NIGHT_MODE_OFF,
val nightStart: String = "", val nightStart: String = "",
val nightEnd: String = "", val nightEnd: String = "",
val black: Boolean = false, val black: Boolean = false,
val autoEmojiEnabled: Boolean = true, val autoEmojiEnabled: Boolean = true,
val notificationsEnabled: Boolean = true, val notificationsEnabled: Boolean = true,
val sendDelaySummary: String = "", val sendDelaySummary: String = "",
val sendDelayId: Int = 0, val sendDelayId: Int = 0,
val deliveryEnabled: Boolean = false, val deliveryEnabled: Boolean = false,
val textSizeSummary: String = "", val textSizeSummary: String = "",
val textSizeId: Int = Preferences.TEXT_SIZE_NORMAL, val textSizeId: Int = Preferences.TEXT_SIZE_NORMAL,
val systemFontEnabled: Boolean = false, val systemFontEnabled: Boolean = false,
val splitSmsEnabled: Boolean = false, val splitSmsEnabled: Boolean = false,
val stripUnicodeEnabled: Boolean = false, val stripUnicodeEnabled: Boolean = false,
val mobileOnly: Boolean = false, val mobileOnly: Boolean = false,
val maxMmsSizeSummary: String = "100KB", val maxMmsSizeSummary: String = "100KB",
val maxMmsSizeId: Int = 100, val maxMmsSizeId: Int = 100,
val syncProgress: SyncRepository.SyncProgress = SyncRepository.SyncProgress.Idle() val syncProgress: SyncRepository.SyncProgress = SyncRepository.SyncProgress.Idle()
) )
@@ -25,7 +25,7 @@ import com.uber.autodispose.kotlin.autoDisposable
import javax.inject.Inject import javax.inject.Inject
class AboutPresenter @Inject constructor( class AboutPresenter @Inject constructor(
private val navigator: Navigator private val navigator: Navigator
) : QkPresenter<AboutView, Unit>(Unit) { ) : QkPresenter<AboutView, Unit>(Unit) {
override fun bindIntents(view: AboutView) { override fun bindIntents(view: AboutView) {
@@ -29,8 +29,8 @@ import io.reactivex.rxkotlin.withLatestFrom
import javax.inject.Inject import javax.inject.Inject
class SwipeActionsPresenter @Inject constructor( class SwipeActionsPresenter @Inject constructor(
context: Context, context: Context,
private val prefs: Preferences private val prefs: Preferences
) : QkPresenter<SwipeActionsView, SwipeActionsState>(SwipeActionsState()) { ) : QkPresenter<SwipeActionsView, SwipeActionsState>(SwipeActionsState()) {
init { init {
@@ -22,9 +22,9 @@ import androidx.annotation.DrawableRes
import com.moez.QKSMS.R import com.moez.QKSMS.R
data class SwipeActionsState( data class SwipeActionsState(
@DrawableRes val rightIcon: Int = R.drawable.ic_archive_black_24dp, @DrawableRes val rightIcon: Int = R.drawable.ic_archive_black_24dp,
val rightLabel: String = "", val rightLabel: String = "",
@DrawableRes val leftIcon: Int = R.drawable.ic_archive_black_24dp, @DrawableRes val leftIcon: Int = R.drawable.ic_archive_black_24dp,
val leftLabel: String = "" val leftLabel: String = ""
) )
@@ -40,8 +40,8 @@ import kotlinx.android.synthetic.main.theme_palette_list_item.view.*
import javax.inject.Inject import javax.inject.Inject
class ThemeAdapter @Inject constructor( class ThemeAdapter @Inject constructor(
private val context: Context, private val context: Context,
private val colors: Colors private val colors: Colors
) : QkAdapter<List<Int>>() { ) : QkAdapter<List<Int>>() {
val colorSelected: Subject<Int> = PublishSubject.create() val colorSelected: Subject<Int> = PublishSubject.create()
@@ -32,12 +32,12 @@ import javax.inject.Inject
import javax.inject.Named import javax.inject.Named
class ThemePickerPresenter @Inject constructor( class ThemePickerPresenter @Inject constructor(
prefs: Preferences, prefs: Preferences,
@Named("threadId") private val threadId: Long, @Named("threadId") private val threadId: Long,
private val billingManager: BillingManager, private val billingManager: BillingManager,
private val colors: Colors, private val colors: Colors,
private val navigator: Navigator, private val navigator: Navigator,
private val widgetManager: WidgetManager private val widgetManager: WidgetManager
) : QkPresenter<ThemePickerView, ThemePickerState>(ThemePickerState(threadId = threadId)) { ) : QkPresenter<ThemePickerView, ThemePickerState>(ThemePickerState(threadId = threadId)) {
private val theme: Preference<Int> = prefs.theme(threadId) private val theme: Preference<Int> = prefs.theme(threadId)
@@ -19,8 +19,8 @@
package com.moez.QKSMS.feature.themepicker package com.moez.QKSMS.feature.themepicker
data class ThemePickerState( data class ThemePickerState(
val threadId: Long = 0, val threadId: Long = 0,
val applyThemeVisible: Boolean = false, val applyThemeVisible: Boolean = false,
val newColor: Int = -1, val newColor: Int = -1,
val newTextColor: Int = -1 val newTextColor: Int = -1
) )
@@ -30,9 +30,9 @@ import javax.inject.Inject
* Blocked conversations will be migrated in SyncManager * Blocked conversations will be migrated in SyncManager
*/ */
class MigratePreferences @Inject constructor( class MigratePreferences @Inject constructor(
private val nightModeManager: NightModeManager, private val nightModeManager: NightModeManager,
private val prefs: Preferences, private val prefs: Preferences,
private val rxPrefs: RxSharedPreferences private val rxPrefs: RxSharedPreferences
) : Interactor<Unit>() { ) : Interactor<Unit>() {
override fun buildObservable(params: Unit): Flowable<*> { override fun buildObservable(params: Unit): Flowable<*> {