forked from upstream-mirrors/quik
Fix indentation for constructor params
This commit is contained in:
@@ -45,10 +45,10 @@ import javax.inject.Singleton
|
||||
|
||||
@Singleton
|
||||
class Navigator @Inject constructor(
|
||||
private val context: Context,
|
||||
private val analyticsManager: AnalyticsManager,
|
||||
private val notificationManager: NotificationManager,
|
||||
private val permissions: PermissionManager
|
||||
private val context: Context,
|
||||
private val analyticsManager: AnalyticsManager,
|
||||
private val notificationManager: NotificationManager,
|
||||
private val permissions: PermissionManager
|
||||
) {
|
||||
|
||||
private fun startActivity(intent: Intent) {
|
||||
|
||||
+8
-8
@@ -37,8 +37,8 @@ inline fun LifecycleOwner.scope(): LifecycleScopeProvider<*> = AndroidLifecycleS
|
||||
* @param untilEvent the event until the scope is valid.
|
||||
*/
|
||||
@CheckReturnValue
|
||||
inline fun LifecycleOwner.scope(untilEvent: Lifecycle.Event): LifecycleScopeProvider<*>
|
||||
= AndroidLifecycleScopeProvider.from(this, untilEvent)
|
||||
inline fun LifecycleOwner.scope(untilEvent: Lifecycle.Event): LifecycleScopeProvider<*> =
|
||||
AndroidLifecycleScopeProvider.from(this, untilEvent)
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
@CheckReturnValue
|
||||
inline fun LifecycleOwner.scope(boundaryResolver: Function<Event, Event>): LifecycleScopeProvider<*>
|
||||
= AndroidLifecycleScopeProvider.from(this, boundaryResolver)
|
||||
inline fun LifecycleOwner.scope(boundaryResolver: Function<Event, Event>): LifecycleScopeProvider<*> =
|
||||
AndroidLifecycleScopeProvider.from(this, boundaryResolver)
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
@CheckReturnValue
|
||||
inline fun Lifecycle.scope(untilEvent: Lifecycle.Event): LifecycleScopeProvider<*>
|
||||
= AndroidLifecycleScopeProvider.from(this, untilEvent)
|
||||
inline fun Lifecycle.scope(untilEvent: Lifecycle.Event): LifecycleScopeProvider<*> =
|
||||
AndroidLifecycleScopeProvider.from(this, untilEvent)
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
@CheckReturnValue
|
||||
inline fun Lifecycle.scope(boundaryResolver: Function<Event, Event>): LifecycleScopeProvider<*>
|
||||
= AndroidLifecycleScopeProvider.from(this, boundaryResolver)
|
||||
inline fun Lifecycle.scope(boundaryResolver: Function<Event, Event>): LifecycleScopeProvider<*> =
|
||||
AndroidLifecycleScopeProvider.from(this, boundaryResolver)
|
||||
@@ -42,8 +42,8 @@ import javax.inject.Singleton
|
||||
|
||||
@Singleton
|
||||
class BillingManager @Inject constructor(
|
||||
context: Context,
|
||||
private val analyticsManager: AnalyticsManager
|
||||
context: Context,
|
||||
private val analyticsManager: AnalyticsManager
|
||||
) : PurchasesUpdatedListener {
|
||||
|
||||
companion object {
|
||||
|
||||
@@ -28,8 +28,8 @@ import com.moez.QKSMS.util.tryOrNull
|
||||
import javax.inject.Inject
|
||||
|
||||
class MessageDetailsFormatter @Inject constructor(
|
||||
private val context: Context,
|
||||
private val dateFormatter: DateFormatter
|
||||
private val context: Context,
|
||||
private val dateFormatter: DateFormatter
|
||||
) {
|
||||
|
||||
fun format(message: Message): String {
|
||||
|
||||
@@ -54,12 +54,12 @@ import javax.inject.Singleton
|
||||
|
||||
@Singleton
|
||||
class NotificationManagerImpl @Inject constructor(
|
||||
private val context: Context,
|
||||
private val colors: Colors,
|
||||
private val conversationRepo: ConversationRepository,
|
||||
private val prefs: Preferences,
|
||||
private val messageRepo: MessageRepository,
|
||||
private val permissions: PermissionManager
|
||||
private val context: Context,
|
||||
private val colors: Colors,
|
||||
private val conversationRepo: ConversationRepository,
|
||||
private val prefs: Preferences,
|
||||
private val messageRepo: MessageRepository,
|
||||
private val permissions: PermissionManager
|
||||
) : com.moez.QKSMS.manager.NotificationManager {
|
||||
|
||||
companion object {
|
||||
|
||||
@@ -37,9 +37,9 @@ import me.leolin.shortcutbadger.ShortcutBadger
|
||||
import javax.inject.Inject
|
||||
|
||||
class ShortcutManagerImpl @Inject constructor(
|
||||
private val context: Context,
|
||||
private val conversationRepo: ConversationRepository,
|
||||
private val messageRepo: MessageRepository
|
||||
private val context: Context,
|
||||
private val conversationRepo: ConversationRepository,
|
||||
private val messageRepo: MessageRepository
|
||||
) : com.moez.QKSMS.manager.ShortcutManager {
|
||||
|
||||
override fun updateBadge() {
|
||||
|
||||
@@ -34,9 +34,9 @@ import com.moez.QKSMS.util.Preferences
|
||||
import javax.inject.Inject
|
||||
|
||||
class TextViewStyler @Inject constructor(
|
||||
private val prefs: Preferences,
|
||||
private val colors: Colors,
|
||||
private val fontProvider: FontProvider
|
||||
private val prefs: Preferences,
|
||||
private val colors: Colors,
|
||||
private val fontProvider: FontProvider
|
||||
) {
|
||||
|
||||
companion object {
|
||||
|
||||
@@ -33,8 +33,8 @@ import kotlinx.android.synthetic.main.backup_list_item.view.*
|
||||
import javax.inject.Inject
|
||||
|
||||
class BackupAdapter @Inject constructor(
|
||||
private val context: Context,
|
||||
private val dateFormatter: DateFormatter
|
||||
private val context: Context,
|
||||
private val dateFormatter: DateFormatter
|
||||
) : FlowableAdapter<BackupFile>() {
|
||||
|
||||
val backupSelected: Subject<BackupFile> = PublishSubject.create()
|
||||
|
||||
@@ -37,13 +37,13 @@ import java.util.concurrent.TimeUnit
|
||||
import javax.inject.Inject
|
||||
|
||||
class BackupPresenter @Inject constructor(
|
||||
private val backupRepo: BackupRepository,
|
||||
private val billingManager: BillingManager,
|
||||
private val context: Context,
|
||||
private val dateFormatter: DateFormatter,
|
||||
private val navigator: Navigator,
|
||||
private val performBackup: PerformBackup,
|
||||
private val permissionManager: PermissionManager
|
||||
private val backupRepo: BackupRepository,
|
||||
private val billingManager: BillingManager,
|
||||
private val context: Context,
|
||||
private val dateFormatter: DateFormatter,
|
||||
private val navigator: Navigator,
|
||||
private val performBackup: PerformBackup,
|
||||
private val permissionManager: PermissionManager
|
||||
) : QkPresenter<BackupView, BackupState>(BackupState()) {
|
||||
|
||||
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
|
||||
|
||||
data class BackupState(
|
||||
val backupProgress: BackupRepository.Progress = BackupRepository.Progress.Idle(),
|
||||
val restoreProgress: BackupRepository.Progress = BackupRepository.Progress.Idle(),
|
||||
val lastBackup: String = "",
|
||||
val backups: List<BackupFile> = listOf(),
|
||||
val upgraded: Boolean = false
|
||||
val backupProgress: BackupRepository.Progress = BackupRepository.Progress.Idle(),
|
||||
val restoreProgress: BackupRepository.Progress = BackupRepository.Progress.Idle(),
|
||||
val lastBackup: String = "",
|
||||
val backups: List<BackupFile> = listOf(),
|
||||
val upgraded: Boolean = false
|
||||
)
|
||||
@@ -22,6 +22,6 @@ import com.moez.QKSMS.model.Conversation
|
||||
import io.realm.RealmResults
|
||||
|
||||
data class BlockedState(
|
||||
val siaEnabled: Boolean = false,
|
||||
val data: RealmResults<Conversation>? = null
|
||||
val siaEnabled: Boolean = false,
|
||||
val data: RealmResults<Conversation>? = null
|
||||
)
|
||||
@@ -33,12 +33,12 @@ import io.reactivex.rxkotlin.withLatestFrom
|
||||
import javax.inject.Inject
|
||||
|
||||
class BlockedViewModel @Inject constructor(
|
||||
private val context: Context,
|
||||
private val analytics: AnalyticsManager,
|
||||
private val conversationRepo: ConversationRepository,
|
||||
private val markUnblocked: MarkUnblocked,
|
||||
private val navigator: Navigator,
|
||||
private val prefs: Preferences
|
||||
private val context: Context,
|
||||
private val analytics: AnalyticsManager,
|
||||
private val conversationRepo: ConversationRepository,
|
||||
private val markUnblocked: MarkUnblocked,
|
||||
private val navigator: Navigator,
|
||||
private val prefs: Preferences
|
||||
) : QkViewModel<BlockedView, BlockedState>(BlockedState()) {
|
||||
|
||||
init {
|
||||
|
||||
@@ -32,7 +32,7 @@ import kotlinx.android.synthetic.main.attachment_list_item.view.*
|
||||
import javax.inject.Inject
|
||||
|
||||
class AttachmentAdapter @Inject constructor(
|
||||
private val context: Context
|
||||
private val context: Context
|
||||
) : QkAdapter<Attachment>() {
|
||||
|
||||
val attachmentDeleted: Subject<Attachment> = PublishSubject.create()
|
||||
|
||||
@@ -26,25 +26,25 @@ import com.moez.QKSMS.model.Message
|
||||
import io.realm.RealmResults
|
||||
|
||||
data class ComposeState(
|
||||
val hasError: Boolean = false,
|
||||
val editingMode: Boolean = false,
|
||||
val contacts: List<Contact> = ArrayList(),
|
||||
val contactsVisible: Boolean = false,
|
||||
val selectedConversation: Long = 0,
|
||||
val selectedContacts: List<Contact> = ArrayList(),
|
||||
val sendAsGroup: Boolean = true,
|
||||
val conversationtitle: String = "",
|
||||
val loading: Boolean = false,
|
||||
val query: String = "",
|
||||
val searchSelectionId: Long = -1,
|
||||
val searchSelectionPosition: Int = 0,
|
||||
val searchResults: Int = 0,
|
||||
val messages: Pair<Conversation, RealmResults<Message>>? = null,
|
||||
val selectedMessages: Int = 0,
|
||||
val scheduled: Long = 0,
|
||||
val attachments: List<Attachment> = ArrayList(),
|
||||
val attaching: Boolean = false,
|
||||
val remaining: String = "",
|
||||
val subscription: SubscriptionInfoCompat? = null,
|
||||
val canSend: Boolean = false
|
||||
val hasError: Boolean = false,
|
||||
val editingMode: Boolean = false,
|
||||
val contacts: List<Contact> = ArrayList(),
|
||||
val contactsVisible: Boolean = false,
|
||||
val selectedConversation: Long = 0,
|
||||
val selectedContacts: List<Contact> = ArrayList(),
|
||||
val sendAsGroup: Boolean = true,
|
||||
val conversationtitle: String = "",
|
||||
val loading: Boolean = false,
|
||||
val query: String = "",
|
||||
val searchSelectionId: Long = -1,
|
||||
val searchSelectionPosition: Int = 0,
|
||||
val searchResults: Int = 0,
|
||||
val messages: Pair<Conversation, RealmResults<Message>>? = null,
|
||||
val selectedMessages: Int = 0,
|
||||
val scheduled: Long = 0,
|
||||
val attachments: List<Attachment> = ArrayList(),
|
||||
val attaching: Boolean = false,
|
||||
val remaining: String = "",
|
||||
val subscription: SubscriptionInfoCompat? = null,
|
||||
val canSend: Boolean = false
|
||||
)
|
||||
@@ -73,30 +73,30 @@ import javax.inject.Inject
|
||||
import javax.inject.Named
|
||||
|
||||
class ComposeViewModel @Inject constructor(
|
||||
@Named("query") private val query: String,
|
||||
@Named("threadId") private val threadId: Long,
|
||||
@Named("address") private val address: String,
|
||||
@Named("text") private val sharedText: String,
|
||||
@Named("attachments") private val sharedAttachments: List<Attachment>,
|
||||
private val context: Context,
|
||||
private val activeConversationManager: ActiveConversationManager,
|
||||
private val addScheduledMessage: AddScheduledMessage,
|
||||
private val billingManager: BillingManager,
|
||||
private val cancelMessage: CancelDelayedMessage,
|
||||
private val contactFilter: ContactFilter,
|
||||
private val contactsRepo: ContactRepository,
|
||||
private val conversationRepo: ConversationRepository,
|
||||
private val deleteMessages: DeleteMessages,
|
||||
private val markRead: MarkRead,
|
||||
private val messageDetailsFormatter: MessageDetailsFormatter,
|
||||
private val messageRepo: MessageRepository,
|
||||
private val navigator: Navigator,
|
||||
private val permissionManager: PermissionManager,
|
||||
private val prefs: Preferences,
|
||||
private val retrySending: RetrySending,
|
||||
private val sendMessage: SendMessage,
|
||||
private val subscriptionManager: SubscriptionManagerCompat,
|
||||
private val syncContacts: ContactSync
|
||||
@Named("query") private val query: String,
|
||||
@Named("threadId") private val threadId: Long,
|
||||
@Named("address") private val address: String,
|
||||
@Named("text") private val sharedText: String,
|
||||
@Named("attachments") private val sharedAttachments: List<Attachment>,
|
||||
private val context: Context,
|
||||
private val activeConversationManager: ActiveConversationManager,
|
||||
private val addScheduledMessage: AddScheduledMessage,
|
||||
private val billingManager: BillingManager,
|
||||
private val cancelMessage: CancelDelayedMessage,
|
||||
private val contactFilter: ContactFilter,
|
||||
private val contactsRepo: ContactRepository,
|
||||
private val conversationRepo: ConversationRepository,
|
||||
private val deleteMessages: DeleteMessages,
|
||||
private val markRead: MarkRead,
|
||||
private val messageDetailsFormatter: MessageDetailsFormatter,
|
||||
private val messageRepo: MessageRepository,
|
||||
private val navigator: Navigator,
|
||||
private val permissionManager: PermissionManager,
|
||||
private val prefs: Preferences,
|
||||
private val retrySending: RetrySending,
|
||||
private val sendMessage: SendMessage,
|
||||
private val subscriptionManager: SubscriptionManagerCompat,
|
||||
private val syncContacts: ContactSync
|
||||
) : QkViewModel<ComposeView, ComposeState>(ComposeState(
|
||||
editingMode = threadId == 0L && address.isBlank(),
|
||||
selectedConversation = threadId,
|
||||
|
||||
@@ -64,12 +64,12 @@ import java.util.concurrent.TimeUnit
|
||||
import javax.inject.Inject
|
||||
|
||||
class MessagesAdapter @Inject constructor(
|
||||
private val context: Context,
|
||||
private val colors: Colors,
|
||||
private val dateFormatter: DateFormatter,
|
||||
private val navigator: Navigator,
|
||||
private val prefs: Preferences,
|
||||
private val subscriptionManager: SubscriptionManagerCompat
|
||||
private val context: Context,
|
||||
private val colors: Colors,
|
||||
private val dateFormatter: DateFormatter,
|
||||
private val navigator: Navigator,
|
||||
private val prefs: Preferences,
|
||||
private val subscriptionManager: SubscriptionManagerCompat
|
||||
) : QkRealmAdapter<Message>() {
|
||||
|
||||
companion object {
|
||||
|
||||
@@ -28,7 +28,7 @@ import com.moez.QKSMS.model.PhoneNumber
|
||||
import kotlinx.android.synthetic.main.contact_list_item.view.*
|
||||
|
||||
class PhoneNumberAdapter(
|
||||
private val numberClicked: (Contact, Int) -> Unit
|
||||
private val numberClicked: (Contact, Int) -> Unit
|
||||
) : QkAdapter<PhoneNumber>() {
|
||||
|
||||
lateinit var contact: Contact
|
||||
|
||||
@@ -40,9 +40,9 @@ import io.reactivex.schedulers.Schedulers
|
||||
import kotlinx.android.synthetic.main.mms_vcard_list_item.view.*
|
||||
|
||||
class VCardBinder(
|
||||
private val context: Context,
|
||||
private val navigator: Navigator,
|
||||
private val theme: Colors.Theme
|
||||
private val context: Context,
|
||||
private val navigator: Navigator,
|
||||
private val theme: Colors.Theme
|
||||
) : PartBinder {
|
||||
|
||||
override val partLayout = R.layout.mms_vcard_list_item
|
||||
|
||||
+9
-9
@@ -38,15 +38,15 @@ import javax.inject.Inject
|
||||
import javax.inject.Named
|
||||
|
||||
class ConversationInfoPresenter @Inject constructor(
|
||||
@Named("threadId") threadId: Long,
|
||||
messageRepo: MessageRepository,
|
||||
private val conversationRepo: ConversationRepository,
|
||||
private val deleteConversations: DeleteConversations,
|
||||
private val markArchived: MarkArchived,
|
||||
private val markUnarchived: MarkUnarchived,
|
||||
private val markBlocked: MarkBlocked,
|
||||
private val markUnblocked: MarkUnblocked,
|
||||
private val navigator: Navigator
|
||||
@Named("threadId") threadId: Long,
|
||||
messageRepo: MessageRepository,
|
||||
private val conversationRepo: ConversationRepository,
|
||||
private val deleteConversations: DeleteConversations,
|
||||
private val markArchived: MarkArchived,
|
||||
private val markUnarchived: MarkUnarchived,
|
||||
private val markBlocked: MarkBlocked,
|
||||
private val markUnblocked: MarkUnblocked,
|
||||
private val navigator: Navigator
|
||||
) : QkPresenter<ConversationInfoView, ConversationInfoState>(
|
||||
ConversationInfoState(threadId = threadId, media = messageRepo.getPartsForConversation(threadId))
|
||||
) {
|
||||
|
||||
+7
-7
@@ -24,11 +24,11 @@ import io.realm.RealmList
|
||||
import io.realm.RealmResults
|
||||
|
||||
data class ConversationInfoState(
|
||||
val name: String = "",
|
||||
val recipients: RealmList<Recipient>? = null,
|
||||
val threadId: Long = 0,
|
||||
val archived: Boolean = false,
|
||||
val blocked: Boolean = false,
|
||||
val media: RealmResults<MmsPart>? = null,
|
||||
val hasError: Boolean = false
|
||||
val name: String = "",
|
||||
val recipients: RealmList<Recipient>? = null,
|
||||
val threadId: Long = 0,
|
||||
val archived: Boolean = false,
|
||||
val blocked: Boolean = false,
|
||||
val media: RealmResults<MmsPart>? = null,
|
||||
val hasError: Boolean = false
|
||||
)
|
||||
+2
-2
@@ -33,8 +33,8 @@ import kotlinx.android.synthetic.main.conversation_media_list_item.view.*
|
||||
import javax.inject.Inject
|
||||
|
||||
class ConversationMediaAdapter @Inject constructor(
|
||||
private val context: Context,
|
||||
private val navigator: Navigator
|
||||
private val context: Context,
|
||||
private val navigator: Navigator
|
||||
) : QkRealmAdapter<MmsPart>() {
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): QkViewHolder {
|
||||
|
||||
+1
-1
@@ -32,7 +32,7 @@ import kotlinx.android.synthetic.main.conversation_recipient_list_item.view.*
|
||||
import javax.inject.Inject
|
||||
|
||||
class ConversationRecipientAdapter @Inject constructor(
|
||||
private val navigator: Navigator
|
||||
private val navigator: Navigator
|
||||
) : QkRealmAdapter<Recipient>() {
|
||||
|
||||
var threadId: Long = 0L
|
||||
|
||||
+4
-4
@@ -42,10 +42,10 @@ import javax.inject.Inject
|
||||
|
||||
|
||||
class ConversationItemTouchCallback @Inject constructor(
|
||||
colors: Colors,
|
||||
disposables: CompositeDisposable,
|
||||
prefs: Preferences,
|
||||
private val context: Context
|
||||
colors: Colors,
|
||||
disposables: CompositeDisposable,
|
||||
prefs: Preferences,
|
||||
private val context: Context
|
||||
) : ItemTouchHelper.SimpleCallback(0, 0) {
|
||||
|
||||
val swipes: Subject<Pair<Long, Int>> = PublishSubject.create()
|
||||
|
||||
+3
-3
@@ -34,9 +34,9 @@ import kotlinx.android.synthetic.main.conversation_list_item.view.*
|
||||
import javax.inject.Inject
|
||||
|
||||
class ConversationsAdapter @Inject constructor(
|
||||
private val context: Context,
|
||||
private val dateFormatter: DateFormatter,
|
||||
private val navigator: Navigator
|
||||
private val context: Context,
|
||||
private val dateFormatter: DateFormatter,
|
||||
private val navigator: Navigator
|
||||
) : QkRealmAdapter<Conversation>() {
|
||||
|
||||
init {
|
||||
|
||||
@@ -48,9 +48,9 @@ import javax.inject.Inject
|
||||
import javax.inject.Named
|
||||
|
||||
class GalleryPagerAdapter @Inject constructor(
|
||||
context: Context,
|
||||
@Named("partId") private val partId: Long,
|
||||
private val dateFormatter: DateFormatter
|
||||
context: Context,
|
||||
@Named("partId") private val partId: Long,
|
||||
private val dateFormatter: DateFormatter
|
||||
) : PagerAdapter() {
|
||||
|
||||
var parts: RealmResults<MmsPart>? = null
|
||||
|
||||
@@ -22,6 +22,7 @@ import com.moez.QKSMS.model.MmsPart
|
||||
import io.realm.RealmResults
|
||||
|
||||
data class GalleryState(
|
||||
val navigationVisible: Boolean = true,
|
||||
val title: String? = "",
|
||||
val parts: RealmResults<MmsPart>? = null)
|
||||
val navigationVisible: Boolean = true,
|
||||
val title: String? = "",
|
||||
val parts: RealmResults<MmsPart>? = null
|
||||
)
|
||||
|
||||
@@ -35,11 +35,11 @@ import javax.inject.Inject
|
||||
import javax.inject.Named
|
||||
|
||||
class GalleryViewModel @Inject constructor(
|
||||
conversationRepo: ConversationRepository,
|
||||
messageRepo: MessageRepository,
|
||||
@Named("partId") private val partId: Long,
|
||||
private val context: Context,
|
||||
private val saveImage: SaveImage
|
||||
conversationRepo: ConversationRepository,
|
||||
messageRepo: MessageRepository,
|
||||
@Named("partId") private val partId: Long,
|
||||
private val context: Context,
|
||||
private val saveImage: SaveImage
|
||||
) : QkViewModel<GalleryView, GalleryState>(GalleryState()) {
|
||||
|
||||
init {
|
||||
|
||||
@@ -25,8 +25,8 @@ import com.moez.QKSMS.manager.AnalyticsManager
|
||||
import javax.inject.Inject
|
||||
|
||||
class DrawerBadgesExperiment @Inject constructor(
|
||||
context: Context,
|
||||
analyticsManager: AnalyticsManager
|
||||
context: Context,
|
||||
analyticsManager: AnalyticsManager
|
||||
) : Experiment<Boolean>(context, analyticsManager) {
|
||||
|
||||
override val key: String = "Drawer Badges"
|
||||
|
||||
@@ -24,32 +24,34 @@ import com.moez.QKSMS.repository.SyncRepository
|
||||
import io.realm.RealmResults
|
||||
|
||||
data class MainState(
|
||||
val hasError: Boolean = false,
|
||||
val page: MainPage = Inbox(),
|
||||
val drawerOpen: Boolean = false,
|
||||
val upgraded: Boolean = true,
|
||||
val showRating: Boolean = false,
|
||||
val syncing: SyncRepository.SyncProgress = SyncRepository.SyncProgress.Idle(),
|
||||
val defaultSms: Boolean = true,
|
||||
val smsPermission: Boolean = true,
|
||||
val contactPermission: Boolean = true
|
||||
val hasError: Boolean = false,
|
||||
val page: MainPage = Inbox(),
|
||||
val drawerOpen: Boolean = false,
|
||||
val upgraded: Boolean = true,
|
||||
val showRating: Boolean = false,
|
||||
val syncing: SyncRepository.SyncProgress = SyncRepository.SyncProgress.Idle(),
|
||||
val defaultSms: Boolean = true,
|
||||
val smsPermission: Boolean = true,
|
||||
val contactPermission: Boolean = true
|
||||
)
|
||||
|
||||
sealed class MainPage
|
||||
|
||||
data class Inbox(
|
||||
val markPinned: Boolean = true,
|
||||
val markRead: Boolean = false,
|
||||
val data: RealmResults<Conversation>? = null,
|
||||
val selected: Int = 0) : MainPage()
|
||||
val markPinned: Boolean = true,
|
||||
val markRead: Boolean = false,
|
||||
val data: RealmResults<Conversation>? = null,
|
||||
val selected: Int = 0
|
||||
) : MainPage()
|
||||
|
||||
data class Searching(
|
||||
val loading: Boolean = false,
|
||||
val data: List<SearchResult>? = null
|
||||
val loading: Boolean = false,
|
||||
val data: List<SearchResult>? = null
|
||||
) : MainPage()
|
||||
|
||||
data class Archived(
|
||||
val markPinned: Boolean = true,
|
||||
val markRead: Boolean = false,
|
||||
val data: RealmResults<Conversation>? = null,
|
||||
val selected: Int = 0) : MainPage()
|
||||
val markPinned: Boolean = true,
|
||||
val markRead: Boolean = false,
|
||||
val data: RealmResults<Conversation>? = null,
|
||||
val selected: Int = 0
|
||||
) : MainPage()
|
||||
|
||||
@@ -53,24 +53,24 @@ import java.util.concurrent.TimeUnit
|
||||
import javax.inject.Inject
|
||||
|
||||
class MainViewModel @Inject constructor(
|
||||
billingManager: BillingManager,
|
||||
markAllSeen: MarkAllSeen,
|
||||
migratePreferences: MigratePreferences,
|
||||
syncRepository: SyncRepository,
|
||||
private val conversationRepo: ConversationRepository,
|
||||
private val deleteConversations: DeleteConversations,
|
||||
private val markArchived: MarkArchived,
|
||||
private val markBlocked: MarkBlocked,
|
||||
private val markPinned: MarkPinned,
|
||||
private val markRead: MarkRead,
|
||||
private val markUnarchived: MarkUnarchived,
|
||||
private val markUnpinned: MarkUnpinned,
|
||||
private val markUnread: MarkUnread,
|
||||
private val navigator: Navigator,
|
||||
private val permissionManager: PermissionManager,
|
||||
private val prefs: Preferences,
|
||||
private val ratingManager: RatingManager,
|
||||
private val syncMessages: SyncMessages
|
||||
billingManager: BillingManager,
|
||||
markAllSeen: MarkAllSeen,
|
||||
migratePreferences: MigratePreferences,
|
||||
syncRepository: SyncRepository,
|
||||
private val conversationRepo: ConversationRepository,
|
||||
private val deleteConversations: DeleteConversations,
|
||||
private val markArchived: MarkArchived,
|
||||
private val markBlocked: MarkBlocked,
|
||||
private val markPinned: MarkPinned,
|
||||
private val markRead: MarkRead,
|
||||
private val markUnarchived: MarkUnarchived,
|
||||
private val markUnpinned: MarkUnpinned,
|
||||
private val markUnread: MarkUnread,
|
||||
private val navigator: Navigator,
|
||||
private val permissionManager: PermissionManager,
|
||||
private val prefs: Preferences,
|
||||
private val ratingManager: RatingManager,
|
||||
private val syncMessages: SyncMessages
|
||||
) : QkViewModel<MainView, MainState>(MainState(page = Inbox(data = conversationRepo.getConversations()))) {
|
||||
|
||||
init {
|
||||
|
||||
@@ -36,10 +36,10 @@ import kotlinx.android.synthetic.main.search_list_item.view.*
|
||||
import javax.inject.Inject
|
||||
|
||||
class SearchAdapter @Inject constructor(
|
||||
colors: Colors,
|
||||
private val context: Context,
|
||||
private val dateFormatter: DateFormatter,
|
||||
private val navigator: Navigator
|
||||
colors: Colors,
|
||||
private val context: Context,
|
||||
private val dateFormatter: DateFormatter,
|
||||
private val navigator: Navigator
|
||||
) : QkAdapter<SearchResult>() {
|
||||
|
||||
private val highlightColor: Int by lazy { colors.theme().highlight }
|
||||
|
||||
+13
-12
@@ -22,15 +22,16 @@ import android.os.Build
|
||||
import com.moez.QKSMS.util.Preferences
|
||||
|
||||
data class NotificationPrefsState(
|
||||
val threadId: Long = 0,
|
||||
val conversationTitle: String = "",
|
||||
val notificationsEnabled: Boolean = true,
|
||||
val previewSummary: String = "",
|
||||
val previewId: Int = Preferences.NOTIFICATION_PREVIEWS_ALL,
|
||||
val action1Summary: String = "",
|
||||
val action2Summary: String = "",
|
||||
val action3Summary: String = "",
|
||||
val vibrationEnabled: Boolean = true,
|
||||
val ringtoneName: String = "",
|
||||
val qkReplyEnabled: Boolean = Build.VERSION.SDK_INT < Build.VERSION_CODES.N,
|
||||
val qkReplyTapDismiss: Boolean = true)
|
||||
val threadId: Long = 0,
|
||||
val conversationTitle: String = "",
|
||||
val notificationsEnabled: Boolean = true,
|
||||
val previewSummary: String = "",
|
||||
val previewId: Int = Preferences.NOTIFICATION_PREVIEWS_ALL,
|
||||
val action1Summary: String = "",
|
||||
val action2Summary: String = "",
|
||||
val action3Summary: String = "",
|
||||
val vibrationEnabled: Boolean = true,
|
||||
val ringtoneName: String = "",
|
||||
val qkReplyEnabled: Boolean = Build.VERSION.SDK_INT < Build.VERSION_CODES.N,
|
||||
val qkReplyTapDismiss: Boolean = true
|
||||
)
|
||||
|
||||
+5
-5
@@ -37,11 +37,11 @@ import javax.inject.Inject
|
||||
import javax.inject.Named
|
||||
|
||||
class NotificationPrefsViewModel @Inject constructor(
|
||||
@Named("threadId") private val threadId: Long,
|
||||
private val context: Context,
|
||||
private val conversationRepo: ConversationRepository,
|
||||
private val navigator: Navigator,
|
||||
private val prefs: Preferences
|
||||
@Named("threadId") private val threadId: Long,
|
||||
private val context: Context,
|
||||
private val conversationRepo: ConversationRepository,
|
||||
private val navigator: Navigator,
|
||||
private val prefs: Preferences
|
||||
) : QkViewModel<NotificationPrefsView, NotificationPrefsState>(NotificationPrefsState(threadId = threadId)) {
|
||||
|
||||
private val notifications = prefs.notifications(threadId)
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
package com.moez.QKSMS.feature.plus
|
||||
|
||||
data class PlusState(
|
||||
val upgraded: Boolean = false,
|
||||
val upgradePrice: String = "",
|
||||
val upgradeDonatePrice: String = "",
|
||||
val currency: String = ""
|
||||
val upgraded: Boolean = false,
|
||||
val upgradePrice: String = "",
|
||||
val upgradeDonatePrice: String = "",
|
||||
val currency: String = ""
|
||||
)
|
||||
@@ -29,9 +29,9 @@ import io.reactivex.rxkotlin.plusAssign
|
||||
import javax.inject.Inject
|
||||
|
||||
class PlusViewModel @Inject constructor(
|
||||
private val analyticsManager: AnalyticsManager,
|
||||
private val billingManager: BillingManager,
|
||||
private val navigator: Navigator
|
||||
private val analyticsManager: AnalyticsManager,
|
||||
private val billingManager: BillingManager,
|
||||
private val navigator: Navigator
|
||||
) : QkViewModel<PlusView, PlusState>(PlusState()) {
|
||||
|
||||
init {
|
||||
|
||||
+2
-2
@@ -27,8 +27,8 @@ import com.moez.QKSMS.manager.AnalyticsManager
|
||||
import javax.inject.Inject
|
||||
|
||||
class UpgradeButtonExperiment @Inject constructor(
|
||||
context: Context,
|
||||
analytics: AnalyticsManager
|
||||
context: Context,
|
||||
analytics: AnalyticsManager
|
||||
) : Experiment<@StringRes Int>(context, analytics) {
|
||||
|
||||
override val key: String = "Upgrade Button"
|
||||
|
||||
@@ -24,12 +24,12 @@ import com.moez.QKSMS.model.Message
|
||||
import io.realm.RealmResults
|
||||
|
||||
data class QkReplyState(
|
||||
val hasError: Boolean = false,
|
||||
val selectedConversation: Long = 0,
|
||||
val title: String = "",
|
||||
val expanded: Boolean = false,
|
||||
val data: Pair<Conversation, RealmResults<Message>>? = null,
|
||||
val remaining: String = "",
|
||||
val subscription: SubscriptionInfoCompat? = null,
|
||||
val canSend: Boolean = false
|
||||
val hasError: Boolean = false,
|
||||
val selectedConversation: Long = 0,
|
||||
val title: String = "",
|
||||
val expanded: Boolean = false,
|
||||
val data: Pair<Conversation, RealmResults<Message>>? = null,
|
||||
val remaining: String = "",
|
||||
val subscription: SubscriptionInfoCompat? = null,
|
||||
val canSend: Boolean = false
|
||||
)
|
||||
@@ -46,14 +46,14 @@ import javax.inject.Inject
|
||||
import javax.inject.Named
|
||||
|
||||
class QkReplyViewModel @Inject constructor(
|
||||
@Named("threadId") private val threadId: Long,
|
||||
private val conversationRepo: ConversationRepository,
|
||||
private val deleteMessages: DeleteMessages,
|
||||
private val markRead: MarkRead,
|
||||
private val messageRepo: MessageRepository,
|
||||
private val navigator: Navigator,
|
||||
private val sendMessage: SendMessage,
|
||||
private val subscriptionManager: SubscriptionManagerCompat
|
||||
@Named("threadId") private val threadId: Long,
|
||||
private val conversationRepo: ConversationRepository,
|
||||
private val deleteMessages: DeleteMessages,
|
||||
private val markRead: MarkRead,
|
||||
private val messageRepo: MessageRepository,
|
||||
private val navigator: Navigator,
|
||||
private val sendMessage: SendMessage,
|
||||
private val subscriptionManager: SubscriptionManagerCompat
|
||||
) : QkViewModel<QkReplyView, QkReplyState>(QkReplyState(selectedConversation = threadId)) {
|
||||
|
||||
private val conversation by lazy {
|
||||
|
||||
+2
-2
@@ -38,8 +38,8 @@ import kotlinx.android.synthetic.main.scheduled_message_list_item.view.*
|
||||
import javax.inject.Inject
|
||||
|
||||
class ScheduledMessageAdapter @Inject constructor(
|
||||
private val contactRepo: ContactRepository,
|
||||
private val dateFormatter: DateFormatter
|
||||
private val contactRepo: ContactRepository,
|
||||
private val dateFormatter: DateFormatter
|
||||
) : QkRealmAdapter<ScheduledMessage>() {
|
||||
|
||||
private val contacts by lazy { contactRepo.getContacts() }
|
||||
|
||||
@@ -22,6 +22,6 @@ import com.moez.QKSMS.model.ScheduledMessage
|
||||
import io.realm.RealmResults
|
||||
|
||||
data class ScheduledState(
|
||||
val scheduledMessages: RealmResults<ScheduledMessage>? = null,
|
||||
val upgraded: Boolean = false
|
||||
val scheduledMessages: RealmResults<ScheduledMessage>? = null,
|
||||
val upgraded: Boolean = false
|
||||
)
|
||||
|
||||
@@ -30,10 +30,10 @@ import io.reactivex.rxkotlin.withLatestFrom
|
||||
import javax.inject.Inject
|
||||
|
||||
class ScheduledViewModel @Inject constructor(
|
||||
billingManager: BillingManager,
|
||||
private val navigator: Navigator,
|
||||
private val scheduledMessageRepo: ScheduledMessageRepository,
|
||||
private val sendScheduledMessage: SendScheduledMessage
|
||||
billingManager: BillingManager,
|
||||
private val navigator: Navigator,
|
||||
private val scheduledMessageRepo: ScheduledMessageRepository,
|
||||
private val sendScheduledMessage: SendScheduledMessage
|
||||
) : QkViewModel<ScheduledView, ScheduledState>(ScheduledState(
|
||||
scheduledMessages = scheduledMessageRepo.getScheduledMessages()
|
||||
)) {
|
||||
|
||||
@@ -39,15 +39,15 @@ import java.util.concurrent.TimeUnit
|
||||
import javax.inject.Inject
|
||||
|
||||
class SettingsPresenter @Inject constructor(
|
||||
private val context: Context,
|
||||
private val billingManager: BillingManager,
|
||||
private val colors: Colors,
|
||||
private val dateFormatter: DateFormatter,
|
||||
private val navigator: Navigator,
|
||||
private val nightModeManager: NightModeManager,
|
||||
private val prefs: Preferences,
|
||||
private val syncMessages: SyncMessages,
|
||||
private val syncRepo: SyncRepository
|
||||
private val context: Context,
|
||||
private val billingManager: BillingManager,
|
||||
private val colors: Colors,
|
||||
private val dateFormatter: DateFormatter,
|
||||
private val navigator: Navigator,
|
||||
private val nightModeManager: NightModeManager,
|
||||
private val prefs: Preferences,
|
||||
private val syncMessages: SyncMessages,
|
||||
private val syncRepo: SyncRepository
|
||||
) : QkPresenter<SettingsView, SettingsState>(SettingsState(theme = colors.theme().theme)) {
|
||||
|
||||
init {
|
||||
|
||||
@@ -22,24 +22,24 @@ import com.moez.QKSMS.repository.SyncRepository
|
||||
import com.moez.QKSMS.util.Preferences
|
||||
|
||||
data class SettingsState(
|
||||
val theme: Int = 0,
|
||||
val nightModeSummary: String = "",
|
||||
val nightModeId: Int = Preferences.NIGHT_MODE_OFF,
|
||||
val nightStart: String = "",
|
||||
val nightEnd: String = "",
|
||||
val black: Boolean = false,
|
||||
val autoEmojiEnabled: Boolean = true,
|
||||
val notificationsEnabled: Boolean = true,
|
||||
val sendDelaySummary: String = "",
|
||||
val sendDelayId: Int = 0,
|
||||
val deliveryEnabled: Boolean = false,
|
||||
val textSizeSummary: String = "",
|
||||
val textSizeId: Int = Preferences.TEXT_SIZE_NORMAL,
|
||||
val systemFontEnabled: Boolean = false,
|
||||
val splitSmsEnabled: Boolean = false,
|
||||
val stripUnicodeEnabled: Boolean = false,
|
||||
val mobileOnly: Boolean = false,
|
||||
val maxMmsSizeSummary: String = "100KB",
|
||||
val maxMmsSizeId: Int = 100,
|
||||
val syncProgress: SyncRepository.SyncProgress = SyncRepository.SyncProgress.Idle()
|
||||
val theme: Int = 0,
|
||||
val nightModeSummary: String = "",
|
||||
val nightModeId: Int = Preferences.NIGHT_MODE_OFF,
|
||||
val nightStart: String = "",
|
||||
val nightEnd: String = "",
|
||||
val black: Boolean = false,
|
||||
val autoEmojiEnabled: Boolean = true,
|
||||
val notificationsEnabled: Boolean = true,
|
||||
val sendDelaySummary: String = "",
|
||||
val sendDelayId: Int = 0,
|
||||
val deliveryEnabled: Boolean = false,
|
||||
val textSizeSummary: String = "",
|
||||
val textSizeId: Int = Preferences.TEXT_SIZE_NORMAL,
|
||||
val systemFontEnabled: Boolean = false,
|
||||
val splitSmsEnabled: Boolean = false,
|
||||
val stripUnicodeEnabled: Boolean = false,
|
||||
val mobileOnly: Boolean = false,
|
||||
val maxMmsSizeSummary: String = "100KB",
|
||||
val maxMmsSizeId: Int = 100,
|
||||
val syncProgress: SyncRepository.SyncProgress = SyncRepository.SyncProgress.Idle()
|
||||
)
|
||||
@@ -25,7 +25,7 @@ import com.uber.autodispose.kotlin.autoDisposable
|
||||
import javax.inject.Inject
|
||||
|
||||
class AboutPresenter @Inject constructor(
|
||||
private val navigator: Navigator
|
||||
private val navigator: Navigator
|
||||
) : QkPresenter<AboutView, Unit>(Unit) {
|
||||
|
||||
override fun bindIntents(view: AboutView) {
|
||||
|
||||
+2
-2
@@ -29,8 +29,8 @@ import io.reactivex.rxkotlin.withLatestFrom
|
||||
import javax.inject.Inject
|
||||
|
||||
class SwipeActionsPresenter @Inject constructor(
|
||||
context: Context,
|
||||
private val prefs: Preferences
|
||||
context: Context,
|
||||
private val prefs: Preferences
|
||||
) : QkPresenter<SwipeActionsView, SwipeActionsState>(SwipeActionsState()) {
|
||||
|
||||
init {
|
||||
|
||||
+4
-4
@@ -22,9 +22,9 @@ import androidx.annotation.DrawableRes
|
||||
import com.moez.QKSMS.R
|
||||
|
||||
data class SwipeActionsState(
|
||||
@DrawableRes val rightIcon: Int = R.drawable.ic_archive_black_24dp,
|
||||
val rightLabel: String = "",
|
||||
@DrawableRes val rightIcon: Int = R.drawable.ic_archive_black_24dp,
|
||||
val rightLabel: String = "",
|
||||
|
||||
@DrawableRes val leftIcon: Int = R.drawable.ic_archive_black_24dp,
|
||||
val leftLabel: String = ""
|
||||
@DrawableRes val leftIcon: Int = R.drawable.ic_archive_black_24dp,
|
||||
val leftLabel: String = ""
|
||||
)
|
||||
@@ -40,8 +40,8 @@ import kotlinx.android.synthetic.main.theme_palette_list_item.view.*
|
||||
import javax.inject.Inject
|
||||
|
||||
class ThemeAdapter @Inject constructor(
|
||||
private val context: Context,
|
||||
private val colors: Colors
|
||||
private val context: Context,
|
||||
private val colors: Colors
|
||||
) : QkAdapter<List<Int>>() {
|
||||
|
||||
val colorSelected: Subject<Int> = PublishSubject.create()
|
||||
|
||||
+6
-6
@@ -32,12 +32,12 @@ import javax.inject.Inject
|
||||
import javax.inject.Named
|
||||
|
||||
class ThemePickerPresenter @Inject constructor(
|
||||
prefs: Preferences,
|
||||
@Named("threadId") private val threadId: Long,
|
||||
private val billingManager: BillingManager,
|
||||
private val colors: Colors,
|
||||
private val navigator: Navigator,
|
||||
private val widgetManager: WidgetManager
|
||||
prefs: Preferences,
|
||||
@Named("threadId") private val threadId: Long,
|
||||
private val billingManager: BillingManager,
|
||||
private val colors: Colors,
|
||||
private val navigator: Navigator,
|
||||
private val widgetManager: WidgetManager
|
||||
) : QkPresenter<ThemePickerView, ThemePickerState>(ThemePickerState(threadId = threadId)) {
|
||||
|
||||
private val theme: Preference<Int> = prefs.theme(threadId)
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
package com.moez.QKSMS.feature.themepicker
|
||||
|
||||
data class ThemePickerState(
|
||||
val threadId: Long = 0,
|
||||
val applyThemeVisible: Boolean = false,
|
||||
val newColor: Int = -1,
|
||||
val newTextColor: Int = -1
|
||||
val threadId: Long = 0,
|
||||
val applyThemeVisible: Boolean = false,
|
||||
val newColor: Int = -1,
|
||||
val newTextColor: Int = -1
|
||||
)
|
||||
@@ -30,9 +30,9 @@ import javax.inject.Inject
|
||||
* Blocked conversations will be migrated in SyncManager
|
||||
*/
|
||||
class MigratePreferences @Inject constructor(
|
||||
private val nightModeManager: NightModeManager,
|
||||
private val prefs: Preferences,
|
||||
private val rxPrefs: RxSharedPreferences
|
||||
private val nightModeManager: NightModeManager,
|
||||
private val prefs: Preferences,
|
||||
private val rxPrefs: RxSharedPreferences
|
||||
) : Interactor<Unit>() {
|
||||
|
||||
override fun buildObservable(params: Unit): Flowable<*> {
|
||||
|
||||
Reference in New Issue
Block a user