forked from upstream-mirrors/quik
Merge pull request #406 from gavine99/no-auto-keyboard-show-on-compose-activity
no keyboard auto-show on compose activity
This commit is contained in:
@@ -57,7 +57,8 @@
|
||||
<activity
|
||||
android:name=".feature.main.MainActivity"
|
||||
android:exported="true"
|
||||
android:launchMode="singleTask">
|
||||
android:launchMode="singleTask"
|
||||
android:windowSoftInputMode="stateAlwaysHidden">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
@@ -70,7 +71,8 @@
|
||||
<activity
|
||||
android:name=".feature.compose.ComposeActivity"
|
||||
android:exported="true"
|
||||
android:parentActivityName=".feature.main.MainActivity">
|
||||
android:parentActivityName=".feature.main.MainActivity"
|
||||
android:windowSoftInputMode="stateHidden">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
@@ -839,10 +839,6 @@ class ComposeActivity : QkThemedActivity(), ComposeView {
|
||||
override fun onBackPressed() = backPressedIntent.onNext(Unit)
|
||||
|
||||
override fun focusMessage() {
|
||||
runOnUiThread {
|
||||
val message = findViewById<QkEditText>(R.id.message)
|
||||
if (message !== null) message.requestFocus()
|
||||
}
|
||||
message.requestFocus()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -113,5 +113,4 @@ interface ComposeView : QkView<ComposeState> {
|
||||
fun showClearCurrentMessageDialog()
|
||||
fun startSpeechRecognition()
|
||||
fun focusMessage()
|
||||
|
||||
}
|
||||
@@ -30,7 +30,6 @@ import android.view.Menu
|
||||
import android.view.MenuItem
|
||||
import android.view.View
|
||||
import android.view.ViewStub
|
||||
import android.widget.LinearLayout
|
||||
import androidx.appcompat.app.ActionBarDrawerToggle
|
||||
import androidx.core.app.ActivityCompat
|
||||
import androidx.core.view.GravityCompat
|
||||
@@ -88,13 +87,8 @@ class MainActivity : QkThemedActivity(), MainView {
|
||||
override val activityResumedIntent: Subject<Boolean> = PublishSubject.create()
|
||||
override val queryChangedIntent by lazy { toolbarSearch.textChanges() }
|
||||
override val composeIntent by lazy { compose.clicks() }
|
||||
override val drawerOpenIntent: Observable<Boolean> by lazy {
|
||||
drawerLayout
|
||||
.drawerOpen(Gravity.START)
|
||||
.doOnNext {
|
||||
dismissKeyboard()
|
||||
inbox.requestFocus();
|
||||
}
|
||||
override val drawerToggledIntent: Observable<Boolean> by lazy {
|
||||
drawerLayout.drawerOpen(Gravity.START)
|
||||
}
|
||||
override val homeIntent: Subject<Unit> = PublishSubject.create()
|
||||
override val navigationIntent: Observable<NavItem> by lazy {
|
||||
@@ -122,10 +116,22 @@ class MainActivity : QkThemedActivity(), MainView {
|
||||
override val undoArchiveIntent: Subject<Unit> = PublishSubject.create()
|
||||
override val snackbarButtonIntent: Subject<Unit> = PublishSubject.create()
|
||||
|
||||
private val viewModel by lazy { ViewModelProviders.of(this, viewModelFactory)[MainViewModel::class.java] }
|
||||
private val toggle by lazy { ActionBarDrawerToggle(this, drawerLayout, toolbar, R.string.main_drawer_open_cd, 0) }
|
||||
private val viewModel by lazy {
|
||||
ViewModelProviders.of(this, viewModelFactory)[MainViewModel::class.java]
|
||||
}
|
||||
private val toggle by lazy {
|
||||
ActionBarDrawerToggle(
|
||||
this,
|
||||
drawerLayout,
|
||||
toolbar,
|
||||
R.string.main_drawer_open_cd,
|
||||
0
|
||||
)
|
||||
}
|
||||
private val itemTouchHelper by lazy { ItemTouchHelper(itemTouchCallback) }
|
||||
private val progressAnimator by lazy { ObjectAnimator.ofInt(syncingProgress, "progress", 0, 0) }
|
||||
private val progressAnimator by lazy {
|
||||
ObjectAnimator.ofInt(syncingProgress, "progress", 0, 0)
|
||||
}
|
||||
private val changelogDialog by lazy { ChangelogDialog(this) }
|
||||
private val snackbar by lazy { findViewById<View>(R.id.snackbar) }
|
||||
private val syncing by lazy { findViewById<View>(R.id.syncing) }
|
||||
@@ -145,8 +151,10 @@ class MainActivity : QkThemedActivity(), MainView {
|
||||
}
|
||||
|
||||
(syncing as? ViewStub)?.setOnInflateListener { _, _ ->
|
||||
syncingProgress?.progressTintList = ColorStateList.valueOf(theme.blockingFirst().theme)
|
||||
syncingProgress?.indeterminateTintList = ColorStateList.valueOf(theme.blockingFirst().theme)
|
||||
syncingProgress?.let {
|
||||
it.progressTintList = ColorStateList.valueOf(theme.blockingFirst().theme)
|
||||
it.indeterminateTintList = ColorStateList.valueOf(theme.blockingFirst().theme)
|
||||
}
|
||||
}
|
||||
|
||||
toggle.syncState()
|
||||
@@ -170,12 +178,13 @@ class MainActivity : QkThemedActivity(), MainView {
|
||||
intArrayOf(android.R.attr.state_activated),
|
||||
intArrayOf(-android.R.attr.state_activated))
|
||||
|
||||
resolveThemeColor(android.R.attr.textColorSecondary)
|
||||
.let { textSecondary -> ColorStateList(states, intArrayOf(theme.theme, textSecondary)) }
|
||||
.let { tintList ->
|
||||
inboxIcon.imageTintList = tintList
|
||||
archivedIcon.imageTintList = tintList
|
||||
}
|
||||
ColorStateList(states, intArrayOf(theme.theme,
|
||||
resolveThemeColor(android.R.attr.textColorSecondary)
|
||||
))
|
||||
.let { tintList ->
|
||||
inboxIcon.imageTintList = tintList
|
||||
archivedIcon.imageTintList = tintList
|
||||
}
|
||||
|
||||
// Miscellaneous views
|
||||
listOf(plusBadge1, plusBadge2).forEach { badge ->
|
||||
@@ -193,10 +202,11 @@ class MainActivity : QkThemedActivity(), MainView {
|
||||
}
|
||||
}
|
||||
|
||||
override fun onNewIntent(intent: Intent?) {
|
||||
super.onNewIntent(intent)
|
||||
intent?.run(onNewIntentIntent::onNext)
|
||||
}
|
||||
override fun onNewIntent(intent: Intent?) =
|
||||
intent?.let {
|
||||
super.onNewIntent(intent)
|
||||
it.run(onNewIntentIntent::onNext)
|
||||
} ?: Unit
|
||||
|
||||
override fun render(state: MainState) {
|
||||
if (state.hasError) {
|
||||
@@ -228,20 +238,28 @@ class MainActivity : QkThemedActivity(), MainView {
|
||||
else -> 0
|
||||
}
|
||||
|
||||
toolbarSearch.setVisible(state.page is Inbox && state.page.selected == 0 || state.page is Searching)
|
||||
toolbarSearch.setVisible(state.page is Inbox &&
|
||||
state.page.selected == 0 ||
|
||||
state.page is Searching
|
||||
)
|
||||
toolbarTitle.setVisible(toolbarSearch.visibility != View.VISIBLE)
|
||||
|
||||
toolbar.menu.findItem(R.id.select_all)?.isVisible = (conversationsAdapter.itemCount > 1) && selectedConversations != 0
|
||||
toolbar.menu.findItem(R.id.archive)?.isVisible = state.page is Inbox && selectedConversations != 0
|
||||
toolbar.menu.findItem(R.id.unarchive)?.isVisible = state.page is Archived && selectedConversations != 0
|
||||
toolbar.menu.findItem(R.id.delete)?.isVisible = selectedConversations != 0
|
||||
toolbar.menu.findItem(R.id.add)?.isVisible = addContact && selectedConversations != 0
|
||||
toolbar.menu.findItem(R.id.pin)?.isVisible = markPinned && selectedConversations != 0
|
||||
toolbar.menu.findItem(R.id.unpin)?.isVisible = !markPinned && selectedConversations != 0
|
||||
toolbar.menu.findItem(R.id.read)?.isVisible = markRead && selectedConversations != 0
|
||||
toolbar.menu.findItem(R.id.unread)?.isVisible = !markRead && selectedConversations != 0
|
||||
toolbar.menu.findItem(R.id.block)?.isVisible = selectedConversations != 0
|
||||
toolbar.menu.findItem(R.id.rename)?.isVisible = selectedConversations == 1
|
||||
toolbar.menu.apply {
|
||||
findItem(R.id.select_all)?.isVisible =
|
||||
(conversationsAdapter.itemCount > 1) && selectedConversations != 0
|
||||
findItem(R.id.archive)?.isVisible =
|
||||
state.page is Inbox && selectedConversations != 0
|
||||
findItem(R.id.unarchive)?.isVisible =
|
||||
state.page is Archived && selectedConversations != 0
|
||||
findItem(R.id.delete)?.isVisible = selectedConversations != 0
|
||||
findItem(R.id.add)?.isVisible = addContact && selectedConversations != 0
|
||||
findItem(R.id.pin)?.isVisible = markPinned && selectedConversations != 0
|
||||
findItem(R.id.unpin)?.isVisible = !markPinned && selectedConversations != 0
|
||||
findItem(R.id.read)?.isVisible = markRead && selectedConversations != 0
|
||||
findItem(R.id.unread)?.isVisible = !markRead && selectedConversations != 0
|
||||
findItem(R.id.block)?.isVisible = selectedConversations != 0
|
||||
findItem(R.id.rename)?.isVisible = selectedConversations == 1
|
||||
}
|
||||
|
||||
listOf(plusBadge1, plusBadge2).forEach { badge ->
|
||||
badge.isVisible = drawerBadgesExperiment.variant && !state.upgraded
|
||||
@@ -251,14 +269,17 @@ class MainActivity : QkThemedActivity(), MainView {
|
||||
rateLayout.setVisible(state.showRating)
|
||||
|
||||
compose.setVisible(state.page is Inbox || state.page is Archived)
|
||||
conversationsAdapter.emptyView = empty.takeIf { state.page is Inbox || state.page is Archived }
|
||||
conversationsAdapter.emptyView = empty.takeIf {
|
||||
state.page is Inbox || state.page is Archived
|
||||
}
|
||||
searchAdapter.emptyView = empty.takeIf { state.page is Searching }
|
||||
|
||||
when (state.page) {
|
||||
is Inbox -> {
|
||||
showBackButton(state.page.selected > 0)
|
||||
title = getString(R.string.main_title_selected, state.page.selected)
|
||||
if (recyclerView.adapter !== conversationsAdapter) recyclerView.adapter = conversationsAdapter
|
||||
if (recyclerView.adapter !== conversationsAdapter)
|
||||
recyclerView.adapter = conversationsAdapter
|
||||
conversationsAdapter.updateData(state.page.data)
|
||||
itemTouchHelper.attachToRecyclerView(recyclerView)
|
||||
empty.setText(R.string.inbox_empty_text)
|
||||
@@ -278,7 +299,8 @@ class MainActivity : QkThemedActivity(), MainView {
|
||||
true -> getString(R.string.main_title_selected, state.page.selected)
|
||||
false -> getString(R.string.title_archived)
|
||||
}
|
||||
if (recyclerView.adapter !== conversationsAdapter) recyclerView.adapter = conversationsAdapter
|
||||
if (recyclerView.adapter !== conversationsAdapter)
|
||||
recyclerView.adapter = conversationsAdapter
|
||||
conversationsAdapter.updateData(state.page.data)
|
||||
itemTouchHelper.attachToRecyclerView(null)
|
||||
empty.setText(R.string.archived_empty_text)
|
||||
@@ -290,22 +312,26 @@ class MainActivity : QkThemedActivity(), MainView {
|
||||
inbox.isActivated = state.page is Inbox
|
||||
archived.isActivated = state.page is Archived
|
||||
|
||||
if (drawerLayout.isDrawerOpen(GravityCompat.START) && !state.drawerOpen) {
|
||||
if (drawerLayout.isDrawerOpen(GravityCompat.START) && !state.drawerOpen)
|
||||
drawerLayout.closeDrawer(GravityCompat.START)
|
||||
} else if (!drawerLayout.isDrawerVisible(GravityCompat.START) && state.drawerOpen) {
|
||||
else if (!drawerLayout.isDrawerVisible(GravityCompat.START) && state.drawerOpen)
|
||||
drawerLayout.openDrawer(GravityCompat.START)
|
||||
}
|
||||
|
||||
when (state.syncing) {
|
||||
is SyncRepository.SyncProgress.Idle -> {
|
||||
syncing.isVisible = false
|
||||
snackbar.isVisible = !state.defaultSms || !state.smsPermission || !state.contactPermission || !state.notificationPermission
|
||||
snackbar.isVisible = (!state.defaultSms ||
|
||||
!state.smsPermission ||
|
||||
!state.contactPermission ||
|
||||
!state.notificationPermission)
|
||||
}
|
||||
|
||||
is SyncRepository.SyncProgress.Running -> {
|
||||
syncing.isVisible = true
|
||||
syncingProgress.max = state.syncing.max
|
||||
progressAnimator.apply { setIntValues(syncingProgress.progress, state.syncing.progress) }.start()
|
||||
progressAnimator.apply {
|
||||
setIntValues(syncingProgress.progress, state.syncing.progress)
|
||||
}.start()
|
||||
syncingProgress.isIndeterminate = state.syncing.indeterminate
|
||||
snackbar.isVisible = false
|
||||
}
|
||||
@@ -338,32 +364,26 @@ class MainActivity : QkThemedActivity(), MainView {
|
||||
}
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
activityResumedIntent.onNext(true)
|
||||
}
|
||||
override fun onResume() =
|
||||
super.onResume().also { activityResumedIntent.onNext(true) }
|
||||
|
||||
override fun onPause() {
|
||||
super.onPause()
|
||||
activityResumedIntent.onNext(false)
|
||||
}
|
||||
override fun onPause() =
|
||||
super.onPause().also { activityResumedIntent.onNext(false) }
|
||||
|
||||
override fun onDestroy() {
|
||||
super.onDestroy()
|
||||
disposables.dispose()
|
||||
}
|
||||
override fun onDestroy() =
|
||||
super.onDestroy().also { disposables.dispose() }
|
||||
|
||||
override fun showBackButton(show: Boolean) {
|
||||
toggle.onDrawerSlide(drawer, if (show) 1f else 0f)
|
||||
toggle.drawerArrowDrawable.color = when (show) {
|
||||
true -> resolveThemeColor(android.R.attr.textColorSecondary)
|
||||
false -> resolveThemeColor(android.R.attr.textColorPrimary)
|
||||
override fun showBackButton(show: Boolean) =
|
||||
toggle.let {
|
||||
it.onDrawerSlide(drawer, if (show) 1f else 0f)
|
||||
it.drawerArrowDrawable.color = when (show) {
|
||||
true -> resolveThemeColor(android.R.attr.textColorSecondary)
|
||||
false -> resolveThemeColor(android.R.attr.textColorPrimary)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun requestDefaultSms() {
|
||||
override fun requestDefaultSms() =
|
||||
navigator.showDefaultSmsDialog(this)
|
||||
}
|
||||
|
||||
override fun requestPermissions() {
|
||||
val permissions = mutableListOf(
|
||||
@@ -372,9 +392,8 @@ class MainActivity : QkThemedActivity(), MainView {
|
||||
Manifest.permission.READ_CONTACTS
|
||||
)
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU)
|
||||
permissions += Manifest.permission.POST_NOTIFICATIONS
|
||||
}
|
||||
|
||||
ActivityCompat.requestPermissions(this, permissions.toTypedArray(), 0)
|
||||
}
|
||||
@@ -384,68 +403,72 @@ class MainActivity : QkThemedActivity(), MainView {
|
||||
toolbarSearch.text = null
|
||||
}
|
||||
|
||||
override fun clearSelection() {
|
||||
conversationsAdapter.clearSelection()
|
||||
}
|
||||
override fun clearSelection() = conversationsAdapter.clearSelection()
|
||||
|
||||
override fun toggleSelectAll() {
|
||||
conversationsAdapter.toggleSelectAll()
|
||||
}
|
||||
override fun toggleSelectAll() = conversationsAdapter.toggleSelectAll()
|
||||
|
||||
override fun themeChanged() {
|
||||
recyclerView.scrapViews()
|
||||
}
|
||||
override fun themeChanged() = recyclerView.scrapViews()
|
||||
|
||||
override fun showBlockingDialog(conversations: List<Long>, block: Boolean) {
|
||||
blockingDialog.show(this, conversations, block)
|
||||
}
|
||||
|
||||
override fun showDeleteDialog(conversations: List<Long>) {
|
||||
val count = conversations.size
|
||||
AlertDialog.Builder(this)
|
||||
.setTitle(R.string.dialog_delete_title)
|
||||
.setMessage(resources.getQuantityString(R.plurals.dialog_delete_message, count, count))
|
||||
.setPositiveButton(R.string.button_delete) { _, _ -> confirmDeleteIntent.onNext(conversations) }
|
||||
.setNegativeButton(R.string.button_cancel, null)
|
||||
.show()
|
||||
.setTitle(R.string.dialog_delete_title)
|
||||
.setMessage(
|
||||
resources.getQuantityString(
|
||||
R.plurals.dialog_delete_message,
|
||||
conversations.size,
|
||||
conversations.size
|
||||
)
|
||||
)
|
||||
.setPositiveButton(R.string.button_delete) { _, _ -> confirmDeleteIntent.onNext(conversations) }
|
||||
.setNegativeButton(R.string.button_cancel, null)
|
||||
.show()
|
||||
}
|
||||
|
||||
override fun showRenameDialog(conversationName: String) {
|
||||
override fun showRenameDialog(conversationName: String) =
|
||||
TextInputDialog(
|
||||
this,
|
||||
getString(R.string.info_name),
|
||||
renameConversationIntent::onNext
|
||||
).setText(conversationName).show()
|
||||
}
|
||||
)
|
||||
.setText(conversationName)
|
||||
.show()
|
||||
|
||||
override fun showChangelog(changelog: ChangelogManager.CumulativeChangelog) {
|
||||
override fun showChangelog(changelog: ChangelogManager.CumulativeChangelog) =
|
||||
changelogDialog.show(changelog)
|
||||
}
|
||||
|
||||
override fun showArchivedSnackbar(countConversationsArchived: Int) {
|
||||
override fun showArchivedSnackbar(countConversationsArchived: Int) =
|
||||
Snackbar.make(
|
||||
drawerLayout,
|
||||
resources.getQuantityString(R.plurals.toast_archived, countConversationsArchived, countConversationsArchived),
|
||||
if (countConversationsArchived < 10) Snackbar.LENGTH_LONG else Snackbar.LENGTH_INDEFINITE
|
||||
).apply {
|
||||
setAction(R.string.button_undo) { undoArchiveIntent.onNext(Unit) }
|
||||
setActionTextColor(colors.theme().theme)
|
||||
show()
|
||||
if (countConversationsArchived < 10) Snackbar.LENGTH_LONG
|
||||
else Snackbar.LENGTH_INDEFINITE
|
||||
).let {
|
||||
it.setAction(R.string.button_undo) { undoArchiveIntent.onNext(Unit) }
|
||||
it.setActionTextColor(colors.theme().theme)
|
||||
it.show()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onCreateOptionsMenu(menu: Menu?): Boolean {
|
||||
menuInflater.inflate(R.menu.main, menu)
|
||||
return super.onCreateOptionsMenu(menu)
|
||||
}
|
||||
override fun onCreateOptionsMenu(menu: Menu?) =
|
||||
menu?.let {
|
||||
menuInflater.inflate(R.menu.main, it)
|
||||
super.onCreateOptionsMenu(it)
|
||||
} ?: false
|
||||
|
||||
override fun onOptionsItemSelected(item: MenuItem): Boolean {
|
||||
optionsItemIntent.onNext(item.itemId)
|
||||
return true
|
||||
}
|
||||
override fun onOptionsItemSelected(item: MenuItem) =
|
||||
optionsItemIntent.onNext(item.itemId).let { true }
|
||||
|
||||
override fun onBackPressed() {
|
||||
backPressedSubject.onNext(NavItem.BACK)
|
||||
}
|
||||
override fun onBackPressed() = backPressedSubject.onNext(NavItem.BACK)
|
||||
|
||||
override fun drawerToggled(opened: Boolean) {
|
||||
if (opened) {
|
||||
dismissKeyboard()
|
||||
if (!inbox.isInTouchMode)
|
||||
inbox.requestFocus()
|
||||
} else
|
||||
toolbarSearch.requestFocus()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ interface MainView : QkView<MainState> {
|
||||
val activityResumedIntent: Observable<Boolean>
|
||||
val queryChangedIntent: Observable<CharSequence>
|
||||
val composeIntent: Observable<Unit>
|
||||
val drawerOpenIntent: Observable<Boolean>
|
||||
val drawerToggledIntent: Observable<Boolean>
|
||||
val homeIntent: Observable<*>
|
||||
val navigationIntent: Observable<NavItem>
|
||||
val optionsItemIntent: Observable<Int>
|
||||
@@ -55,7 +55,7 @@ interface MainView : QkView<MainState> {
|
||||
fun showRenameDialog(conversationName: String)
|
||||
fun showChangelog(changelog: ChangelogManager.CumulativeChangelog)
|
||||
fun showArchivedSnackbar(countConversationsArchived: Int)
|
||||
|
||||
fun drawerToggled(opened: Boolean)
|
||||
}
|
||||
|
||||
enum class NavItem { BACK, INBOX, ARCHIVED, BACKUP, SCHEDULED, BLOCKING, SETTINGS, PLUS, HELP, INVITE }
|
||||
|
||||
@@ -82,8 +82,10 @@ class MainViewModel @Inject constructor(
|
||||
private val ratingManager: RatingManager,
|
||||
private val syncContacts: SyncContacts,
|
||||
private val syncMessages: SyncMessages
|
||||
) : QkViewModel<MainView, MainState>(MainState(page = Inbox(data = conversationRepo.getConversations(prefs.unreadAtTop.get())))) {
|
||||
private val lastArchivedThreadIds = ArrayList<Long>()
|
||||
) : QkViewModel<MainView, MainState>(
|
||||
MainState(page = Inbox(data = conversationRepo.getConversations(prefs.unreadAtTop.get())))
|
||||
) {
|
||||
private var lastArchivedThreadIds = listOf<Long>(0)
|
||||
|
||||
init {
|
||||
disposables += deleteConversations
|
||||
@@ -293,9 +295,13 @@ class MainViewModel @Inject constructor(
|
||||
.autoDisposable(view.scope())
|
||||
.subscribe()
|
||||
|
||||
view.drawerOpenIntent
|
||||
.autoDisposable(view.scope())
|
||||
.subscribe { open -> newState { copy(drawerOpen = open) } }
|
||||
view.drawerToggledIntent
|
||||
.doOnNext {
|
||||
newState { copy(drawerOpen = it) }
|
||||
view.drawerToggled(it)
|
||||
}
|
||||
.autoDisposable(view.scope())
|
||||
.subscribe { open -> newState { copy(drawerOpen = open) } }
|
||||
|
||||
view.navigationIntent
|
||||
.withLatestFrom(state) { drawerItem, state ->
|
||||
@@ -342,9 +348,8 @@ class MainViewModel @Inject constructor(
|
||||
.filter { itemId -> itemId == R.id.archive }
|
||||
.withLatestFrom(view.conversationsSelectedIntent) { _, conversations ->
|
||||
markArchived.execute(conversations)
|
||||
lastArchivedThreadIds.clear()
|
||||
conversations.forEach { conversation -> lastArchivedThreadIds.add(conversation) }
|
||||
view.showArchivedSnackbar(conversations.count())
|
||||
lastArchivedThreadIds = conversations.toList()
|
||||
view.showArchivedSnackbar(lastArchivedThreadIds.count())
|
||||
view.clearSelection()
|
||||
}
|
||||
.autoDisposable(view.scope())
|
||||
@@ -518,8 +523,7 @@ class MainViewModel @Inject constructor(
|
||||
when (action) {
|
||||
Preferences.SWIPE_ACTION_ARCHIVE ->
|
||||
markArchived.execute(listOf(threadId)) {
|
||||
lastArchivedThreadIds.clear()
|
||||
lastArchivedThreadIds.add(threadId)
|
||||
lastArchivedThreadIds = listOf(threadId)
|
||||
view.showArchivedSnackbar(1)
|
||||
}
|
||||
Preferences.SWIPE_ACTION_DELETE ->
|
||||
@@ -543,8 +547,8 @@ class MainViewModel @Inject constructor(
|
||||
view.undoArchiveIntent
|
||||
.autoDisposable(view.scope())
|
||||
.subscribe {
|
||||
markUnarchived.execute(lastArchivedThreadIds)
|
||||
lastArchivedThreadIds.clear()
|
||||
markUnarchived.execute(lastArchivedThreadIds.toList())
|
||||
lastArchivedThreadIds = listOf()
|
||||
}
|
||||
|
||||
view.snackbarButtonIntent
|
||||
|
||||
@@ -62,9 +62,7 @@
|
||||
app:textSize="primary"
|
||||
tools:textSize="16sp"
|
||||
android:focusable="true"
|
||||
android:focusableInTouchMode="true"
|
||||
android:nextFocusRight="@+id/compose" />
|
||||
|
||||
</androidx.appcompat.widget.Toolbar>
|
||||
|
||||
<dev.octoshrimpy.quik.common.widget.QkTextView
|
||||
|
||||
Reference in New Issue
Block a user