mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-08-28 05:24:44 +00:00
android, desktop: rework UX of creating new connection (#3529)
* android, desktop: rework UX of creating new connection * different place for clipboard listener * changes * changes * changes * button, strings * focus * code optimization and search icon * incognito link * comment * paddings * optimization * icon size and space in search * appbar background color * secondary color for icons in search bar * lighter tool bar and avatars * darker avatars in toolbar * background for selected item and divider * replacing connection view with actual chat view * clear * close unneeded view * filter icon background * filter doesn't hide current chat with empty search field * fixes for review * clearing focus on hiding keyboard * fix invalid qr code message * rename * color * buttons and text visibility when chat is not running yet * loading chats label --------- Co-authored-by: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> Co-authored-by: spaced4ndy <8711996+spaced4ndy@users.noreply.github.com>
This commit is contained in:
co-authored by
Evgeny Poberezkin
spaced4ndy
parent
2bacc00a06
commit
9c061508a4
@@ -1,6 +1,9 @@
|
||||
package chat.simplex.app
|
||||
|
||||
import android.app.Application
|
||||
import android.content.Context
|
||||
import androidx.compose.ui.platform.ClipboardManager
|
||||
import chat.simplex.common.platform.Log
|
||||
import android.app.UiModeManager
|
||||
import android.os.*
|
||||
import androidx.lifecycle.*
|
||||
@@ -95,6 +98,13 @@ class SimplexApp: Application(), LifecycleEventObserver {
|
||||
}
|
||||
Lifecycle.Event.ON_RESUME -> {
|
||||
isAppOnForeground = true
|
||||
/**
|
||||
* When the app calls [ClipboardManager.shareText] and a user copies text in clipboard, Android denies
|
||||
* access to clipboard because the app considered in background.
|
||||
* This will ensure that the app will get the event on resume
|
||||
* */
|
||||
val service = androidAppContext.getSystemService(Context.CLIPBOARD_SERVICE) as android.content.ClipboardManager
|
||||
chatModel.clipboardHasText.value = service.hasPrimaryClip()
|
||||
if (chatModel.controller.appPrefs.onboardingStage.get() == OnboardingStage.OnboardingComplete && chatModel.currentUser.value != null) {
|
||||
SimplexService.showBackgroundServiceNoticeIfNeeded()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user