mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-10-05 11:18:24 +00:00
fix: address the audit of the shared UI settings and display locals
- UiSettings (enums) and UiSettingsFlow move on to headless commons, and UiSettingsState to commons.state. Their StringResource labels become `resourceId` extension properties in commonsUI (the TorType pattern). commons applies the serialization plugin, so UiSettings gets its kotlinx serializer back: in commonsUI it had none, and the encrypted-preferences fallback (JsonMapper.fromJson<UiSettings>) would silently drop a user's old settings. New UiSettingsSerializationTest round-trips it. - tools/r8-verify/reflection-contract.txt names the eight persisted settings enums by their new package; the release check would fail. - LocalDisplaySettings is a compositionLocalOf: it follows Wi-Fi/metered changes, and as a static local it recomposed everything under the theme. It drops the three fields nothing read. - The remaining avatar sites (drawer, account switcher, top bar, group cards, ...) read LocalDisplaySettings instead of a one-off snapshot of accountViewModel.settings, so they follow setting changes like the feed. - 13 loaders left with an unused accountViewModel parameter after the LocalCache switch drop it (206 call sites). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0168wY9t7i9NC5u3svyMxEz6
This commit is contained in:
@@ -22282,7 +22282,7 @@ SPLcom/vitorpamplona/amethyst/AppModules;->getThumbnailDiskCache()Lcom/vitorpamp
|
|||||||
SPLcom/vitorpamplona/amethyst/AppModules;->getTorManager()Lcom/vitorpamplona/amethyst/ui/tor/TorManager;
|
SPLcom/vitorpamplona/amethyst/AppModules;->getTorManager()Lcom/vitorpamplona/amethyst/ui/tor/TorManager;
|
||||||
SPLcom/vitorpamplona/amethyst/AppModules;->getTorPrefs()Lcom/vitorpamplona/amethyst/model/preferences/TorSharedPreferences;
|
SPLcom/vitorpamplona/amethyst/AppModules;->getTorPrefs()Lcom/vitorpamplona/amethyst/model/preferences/TorSharedPreferences;
|
||||||
SPLcom/vitorpamplona/amethyst/AppModules;->getUiPrefs()Lcom/vitorpamplona/amethyst/model/preferences/UiSharedPreferences;
|
SPLcom/vitorpamplona/amethyst/AppModules;->getUiPrefs()Lcom/vitorpamplona/amethyst/model/preferences/UiSharedPreferences;
|
||||||
SPLcom/vitorpamplona/amethyst/AppModules;->getUiState()Lcom/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState;
|
SPLcom/vitorpamplona/amethyst/AppModules;->getUiState()Lcom/vitorpamplona/amethyst/commons/state/UiSettingsState;
|
||||||
SPLcom/vitorpamplona/amethyst/AppModules;->getVideoCache()Lcom/vitorpamplona/amethyst/service/playback/diskCache/VideoCache;
|
SPLcom/vitorpamplona/amethyst/AppModules;->getVideoCache()Lcom/vitorpamplona/amethyst/service/playback/diskCache/VideoCache;
|
||||||
SPLcom/vitorpamplona/amethyst/AppModules;->httpUsageInterceptor$lambda$0(Lcom/vitorpamplona/amethyst/AppModules;)Z
|
SPLcom/vitorpamplona/amethyst/AppModules;->httpUsageInterceptor$lambda$0(Lcom/vitorpamplona/amethyst/AppModules;)Z
|
||||||
SPLcom/vitorpamplona/amethyst/AppModules;->httpUsageInterceptor$lambda$1(Lcom/vitorpamplona/amethyst/AppModules;)Z
|
SPLcom/vitorpamplona/amethyst/AppModules;->httpUsageInterceptor$lambda$1(Lcom/vitorpamplona/amethyst/AppModules;)Z
|
||||||
@@ -22301,7 +22301,7 @@ SPLcom/vitorpamplona/amethyst/AppModules;->signerPermissionStore_delegate$lambda
|
|||||||
SPLcom/vitorpamplona/amethyst/AppModules;->thumbnailDiskCache_delegate$lambda$0(Lcom/vitorpamplona/amethyst/AppModules;)Lcom/vitorpamplona/amethyst/service/images/ThumbnailDiskCache;
|
SPLcom/vitorpamplona/amethyst/AppModules;->thumbnailDiskCache_delegate$lambda$0(Lcom/vitorpamplona/amethyst/AppModules;)Lcom/vitorpamplona/amethyst/service/images/ThumbnailDiskCache;
|
||||||
SPLcom/vitorpamplona/amethyst/AppModules;->torPrefs_delegate$lambda$0(Lcom/vitorpamplona/amethyst/AppModules;)Lcom/vitorpamplona/amethyst/model/preferences/TorSharedPreferences;
|
SPLcom/vitorpamplona/amethyst/AppModules;->torPrefs_delegate$lambda$0(Lcom/vitorpamplona/amethyst/AppModules;)Lcom/vitorpamplona/amethyst/model/preferences/TorSharedPreferences;
|
||||||
SPLcom/vitorpamplona/amethyst/AppModules;->uiPrefs_delegate$lambda$0(Lcom/vitorpamplona/amethyst/AppModules;)Lcom/vitorpamplona/amethyst/model/preferences/UiSharedPreferences;
|
SPLcom/vitorpamplona/amethyst/AppModules;->uiPrefs_delegate$lambda$0(Lcom/vitorpamplona/amethyst/AppModules;)Lcom/vitorpamplona/amethyst/model/preferences/UiSharedPreferences;
|
||||||
SPLcom/vitorpamplona/amethyst/AppModules;->uiState_delegate$lambda$0(Lcom/vitorpamplona/amethyst/AppModules;)Lcom/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState;
|
SPLcom/vitorpamplona/amethyst/AppModules;->uiState_delegate$lambda$0(Lcom/vitorpamplona/amethyst/AppModules;)Lcom/vitorpamplona/amethyst/commons/state/UiSettingsState;
|
||||||
SPLcom/vitorpamplona/amethyst/AppModules;->videoCache_delegate$lambda$0(Lcom/vitorpamplona/amethyst/AppModules;)Lcom/vitorpamplona/amethyst/service/playback/diskCache/VideoCache;
|
SPLcom/vitorpamplona/amethyst/AppModules;->videoCache_delegate$lambda$0(Lcom/vitorpamplona/amethyst/AppModules;)Lcom/vitorpamplona/amethyst/service/playback/diskCache/VideoCache;
|
||||||
Lcom/vitorpamplona/amethyst/AppModules$$ExternalSyntheticLambda0;
|
Lcom/vitorpamplona/amethyst/AppModules$$ExternalSyntheticLambda0;
|
||||||
SPLcom/vitorpamplona/amethyst/AppModules$$ExternalSyntheticLambda0;-><init>(Landroid/content/Context;)V
|
SPLcom/vitorpamplona/amethyst/AppModules$$ExternalSyntheticLambda0;-><init>(Landroid/content/Context;)V
|
||||||
@@ -24832,49 +24832,49 @@ SPLcom/vitorpamplona/amethyst/ui/screen/ComposableSingletons$AccountScreenKt;->l
|
|||||||
Lcom/vitorpamplona/amethyst/ui/screen/ComposableSingletons$AccountScreenKt$$ExternalSyntheticLambda0;
|
Lcom/vitorpamplona/amethyst/ui/screen/ComposableSingletons$AccountScreenKt$$ExternalSyntheticLambda0;
|
||||||
SPLcom/vitorpamplona/amethyst/ui/screen/ComposableSingletons$AccountScreenKt$$ExternalSyntheticLambda0;-><init>()V
|
SPLcom/vitorpamplona/amethyst/ui/screen/ComposableSingletons$AccountScreenKt$$ExternalSyntheticLambda0;-><init>()V
|
||||||
SPLcom/vitorpamplona/amethyst/ui/screen/ComposableSingletons$AccountScreenKt$$ExternalSyntheticLambda0;->invoke(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
SPLcom/vitorpamplona/amethyst/ui/screen/ComposableSingletons$AccountScreenKt$$ExternalSyntheticLambda0;->invoke(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
||||||
Lcom/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState;
|
Lcom/vitorpamplona/amethyst/commons/state/UiSettingsState;
|
||||||
SPLcom/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState;-><clinit>()V
|
SPLcom/vitorpamplona/amethyst/commons/state/UiSettingsState;-><clinit>()V
|
||||||
SPLcom/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState;-><init>(Lcom/vitorpamplona/amethyst/commons/model/UiSettingsFlow;Lkotlinx/coroutines/flow/StateFlow;Lkotlinx/coroutines/CoroutineScope;)V
|
SPLcom/vitorpamplona/amethyst/commons/state/UiSettingsState;-><init>(Lcom/vitorpamplona/amethyst/commons/model/UiSettingsFlow;Lkotlinx/coroutines/flow/StateFlow;Lkotlinx/coroutines/CoroutineScope;)V
|
||||||
Lcom/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState$WhenMappings;
|
Lcom/vitorpamplona/amethyst/commons/state/UiSettingsState$WhenMappings;
|
||||||
SPLcom/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState$WhenMappings;-><clinit>()V
|
SPLcom/vitorpamplona/amethyst/commons/state/UiSettingsState$WhenMappings;-><clinit>()V
|
||||||
Lcom/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState$showImages$1;
|
Lcom/vitorpamplona/amethyst/commons/state/UiSettingsState$showImages$1;
|
||||||
SPLcom/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState$showImages$1;-><init>(Lkotlin/coroutines/Continuation;)V
|
SPLcom/vitorpamplona/amethyst/commons/state/UiSettingsState$showImages$1;-><init>(Lkotlin/coroutines/Continuation;)V
|
||||||
SPLcom/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState$showImages$1;->invoke(Lcom/vitorpamplona/amethyst/commons/model/ConnectivityType;ZLkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
SPLcom/vitorpamplona/amethyst/commons/state/UiSettingsState$showImages$1;->invoke(Lcom/vitorpamplona/amethyst/commons/model/ConnectivityType;ZLkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||||
SPLcom/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState$showImages$1;->invoke(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
SPLcom/vitorpamplona/amethyst/commons/state/UiSettingsState$showImages$1;->invoke(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
||||||
SPLcom/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState$showImages$1;->invokeSuspend(Ljava/lang/Object;)Ljava/lang/Object;
|
SPLcom/vitorpamplona/amethyst/commons/state/UiSettingsState$showImages$1;->invokeSuspend(Ljava/lang/Object;)Ljava/lang/Object;
|
||||||
Lcom/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState$showImages$1$WhenMappings;
|
Lcom/vitorpamplona/amethyst/commons/state/UiSettingsState$showImages$1$WhenMappings;
|
||||||
SPLcom/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState$showImages$1$WhenMappings;-><clinit>()V
|
SPLcom/vitorpamplona/amethyst/commons/state/UiSettingsState$showImages$1$WhenMappings;-><clinit>()V
|
||||||
Lcom/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState$showProfilePictures$1;
|
Lcom/vitorpamplona/amethyst/commons/state/UiSettingsState$showProfilePictures$1;
|
||||||
SPLcom/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState$showProfilePictures$1;-><init>(Lkotlin/coroutines/Continuation;)V
|
SPLcom/vitorpamplona/amethyst/commons/state/UiSettingsState$showProfilePictures$1;-><init>(Lkotlin/coroutines/Continuation;)V
|
||||||
SPLcom/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState$showProfilePictures$1;->invoke(Lcom/vitorpamplona/amethyst/commons/model/ConnectivityType;ZLkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
SPLcom/vitorpamplona/amethyst/commons/state/UiSettingsState$showProfilePictures$1;->invoke(Lcom/vitorpamplona/amethyst/commons/model/ConnectivityType;ZLkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||||
SPLcom/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState$showProfilePictures$1;->invoke(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
SPLcom/vitorpamplona/amethyst/commons/state/UiSettingsState$showProfilePictures$1;->invoke(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
||||||
SPLcom/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState$showProfilePictures$1;->invokeSuspend(Ljava/lang/Object;)Ljava/lang/Object;
|
SPLcom/vitorpamplona/amethyst/commons/state/UiSettingsState$showProfilePictures$1;->invokeSuspend(Ljava/lang/Object;)Ljava/lang/Object;
|
||||||
Lcom/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState$showProfilePictures$1$WhenMappings;
|
Lcom/vitorpamplona/amethyst/commons/state/UiSettingsState$showProfilePictures$1$WhenMappings;
|
||||||
SPLcom/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState$showProfilePictures$1$WhenMappings;-><clinit>()V
|
SPLcom/vitorpamplona/amethyst/commons/state/UiSettingsState$showProfilePictures$1$WhenMappings;-><clinit>()V
|
||||||
Lcom/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState$showUrlPreview$1;
|
Lcom/vitorpamplona/amethyst/commons/state/UiSettingsState$showUrlPreview$1;
|
||||||
SPLcom/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState$showUrlPreview$1;-><init>(Lkotlin/coroutines/Continuation;)V
|
SPLcom/vitorpamplona/amethyst/commons/state/UiSettingsState$showUrlPreview$1;-><init>(Lkotlin/coroutines/Continuation;)V
|
||||||
SPLcom/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState$showUrlPreview$1;->invoke(Lcom/vitorpamplona/amethyst/commons/model/ConnectivityType;ZLkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
SPLcom/vitorpamplona/amethyst/commons/state/UiSettingsState$showUrlPreview$1;->invoke(Lcom/vitorpamplona/amethyst/commons/model/ConnectivityType;ZLkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||||
SPLcom/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState$showUrlPreview$1;->invoke(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
SPLcom/vitorpamplona/amethyst/commons/state/UiSettingsState$showUrlPreview$1;->invoke(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
||||||
SPLcom/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState$showUrlPreview$1;->invokeSuspend(Ljava/lang/Object;)Ljava/lang/Object;
|
SPLcom/vitorpamplona/amethyst/commons/state/UiSettingsState$showUrlPreview$1;->invokeSuspend(Ljava/lang/Object;)Ljava/lang/Object;
|
||||||
Lcom/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState$showUrlPreview$1$WhenMappings;
|
Lcom/vitorpamplona/amethyst/commons/state/UiSettingsState$showUrlPreview$1$WhenMappings;
|
||||||
SPLcom/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState$showUrlPreview$1$WhenMappings;-><clinit>()V
|
SPLcom/vitorpamplona/amethyst/commons/state/UiSettingsState$showUrlPreview$1$WhenMappings;-><clinit>()V
|
||||||
Lcom/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState$special$$inlined$map$1;
|
Lcom/vitorpamplona/amethyst/commons/state/UiSettingsState$special$$inlined$map$1;
|
||||||
SPLcom/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState$special$$inlined$map$1;-><init>(Lkotlinx/coroutines/flow/Flow;)V
|
SPLcom/vitorpamplona/amethyst/commons/state/UiSettingsState$special$$inlined$map$1;-><init>(Lkotlinx/coroutines/flow/Flow;)V
|
||||||
SPLcom/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState$special$$inlined$map$1;->collect(Lkotlinx/coroutines/flow/FlowCollector;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
SPLcom/vitorpamplona/amethyst/commons/state/UiSettingsState$special$$inlined$map$1;->collect(Lkotlinx/coroutines/flow/FlowCollector;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||||
Lcom/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState$special$$inlined$map$1$1;
|
Lcom/vitorpamplona/amethyst/commons/state/UiSettingsState$special$$inlined$map$1$1;
|
||||||
SPLcom/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState$special$$inlined$map$1$1;-><init>(Lcom/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState$special$$inlined$map$1;Lkotlin/coroutines/Continuation;)V
|
SPLcom/vitorpamplona/amethyst/commons/state/UiSettingsState$special$$inlined$map$1$1;-><init>(Lcom/vitorpamplona/amethyst/commons/state/UiSettingsState$special$$inlined$map$1;Lkotlin/coroutines/Continuation;)V
|
||||||
Lcom/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState$special$$inlined$map$1$2;
|
Lcom/vitorpamplona/amethyst/commons/state/UiSettingsState$special$$inlined$map$1$2;
|
||||||
SPLcom/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState$special$$inlined$map$1$2;-><init>(Lkotlinx/coroutines/flow/FlowCollector;)V
|
SPLcom/vitorpamplona/amethyst/commons/state/UiSettingsState$special$$inlined$map$1$2;-><init>(Lkotlinx/coroutines/flow/FlowCollector;)V
|
||||||
SPLcom/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState$special$$inlined$map$1$2;->emit(Ljava/lang/Object;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
SPLcom/vitorpamplona/amethyst/commons/state/UiSettingsState$special$$inlined$map$1$2;->emit(Ljava/lang/Object;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||||
Lcom/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState$special$$inlined$map$1$2$1;
|
Lcom/vitorpamplona/amethyst/commons/state/UiSettingsState$special$$inlined$map$1$2$1;
|
||||||
SPLcom/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState$special$$inlined$map$1$2$1;-><init>(Lcom/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState$special$$inlined$map$1$2;Lkotlin/coroutines/Continuation;)V
|
SPLcom/vitorpamplona/amethyst/commons/state/UiSettingsState$special$$inlined$map$1$2$1;-><init>(Lcom/vitorpamplona/amethyst/commons/state/UiSettingsState$special$$inlined$map$1$2;Lkotlin/coroutines/Continuation;)V
|
||||||
Lcom/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState$startVideoPlayback$1;
|
Lcom/vitorpamplona/amethyst/commons/state/UiSettingsState$startVideoPlayback$1;
|
||||||
SPLcom/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState$startVideoPlayback$1;-><init>(Lkotlin/coroutines/Continuation;)V
|
SPLcom/vitorpamplona/amethyst/commons/state/UiSettingsState$startVideoPlayback$1;-><init>(Lkotlin/coroutines/Continuation;)V
|
||||||
SPLcom/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState$startVideoPlayback$1;->invoke(Lcom/vitorpamplona/amethyst/commons/model/ConnectivityType;ZLkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
SPLcom/vitorpamplona/amethyst/commons/state/UiSettingsState$startVideoPlayback$1;->invoke(Lcom/vitorpamplona/amethyst/commons/model/ConnectivityType;ZLkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||||
SPLcom/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState$startVideoPlayback$1;->invoke(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
SPLcom/vitorpamplona/amethyst/commons/state/UiSettingsState$startVideoPlayback$1;->invoke(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
||||||
SPLcom/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState$startVideoPlayback$1;->invokeSuspend(Ljava/lang/Object;)Ljava/lang/Object;
|
SPLcom/vitorpamplona/amethyst/commons/state/UiSettingsState$startVideoPlayback$1;->invokeSuspend(Ljava/lang/Object;)Ljava/lang/Object;
|
||||||
Lcom/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState$startVideoPlayback$1$WhenMappings;
|
Lcom/vitorpamplona/amethyst/commons/state/UiSettingsState$startVideoPlayback$1$WhenMappings;
|
||||||
SPLcom/vitorpamplona/amethyst/commons/ui/screen/UiSettingsState$startVideoPlayback$1$WhenMappings;-><clinit>()V
|
SPLcom/vitorpamplona/amethyst/commons/state/UiSettingsState$startVideoPlayback$1$WhenMappings;-><clinit>()V
|
||||||
Lcom/vitorpamplona/amethyst/ui/screen/loggedIn/apps/recommendations/datasource/ProfileAppRecommendationsFilterAssembler;
|
Lcom/vitorpamplona/amethyst/ui/screen/loggedIn/apps/recommendations/datasource/ProfileAppRecommendationsFilterAssembler;
|
||||||
SPLcom/vitorpamplona/amethyst/ui/screen/loggedIn/apps/recommendations/datasource/ProfileAppRecommendationsFilterAssembler;-><clinit>()V
|
SPLcom/vitorpamplona/amethyst/ui/screen/loggedIn/apps/recommendations/datasource/ProfileAppRecommendationsFilterAssembler;-><clinit>()V
|
||||||
SPLcom/vitorpamplona/amethyst/ui/screen/loggedIn/apps/recommendations/datasource/ProfileAppRecommendationsFilterAssembler;-><init>(Lcom/vitorpamplona/quartz/nip01Core/relay/client/INostrClient;)V
|
SPLcom/vitorpamplona/amethyst/ui/screen/loggedIn/apps/recommendations/datasource/ProfileAppRecommendationsFilterAssembler;-><init>(Lcom/vitorpamplona/quartz/nip01Core/relay/client/INostrClient;)V
|
||||||
|
|||||||
@@ -56,8 +56,8 @@ import com.vitorpamplona.amethyst.commons.service.http.OnionLocationCache
|
|||||||
import com.vitorpamplona.amethyst.commons.service.lnurl.OkHttpLnurlEndpointResolver
|
import com.vitorpamplona.amethyst.commons.service.lnurl.OkHttpLnurlEndpointResolver
|
||||||
import com.vitorpamplona.amethyst.commons.service.pow.PoWPolicy
|
import com.vitorpamplona.amethyst.commons.service.pow.PoWPolicy
|
||||||
import com.vitorpamplona.amethyst.commons.service.pow.PoWPublishQueue
|
import com.vitorpamplona.amethyst.commons.service.pow.PoWPublishQueue
|
||||||
|
import com.vitorpamplona.amethyst.commons.state.UiSettingsState
|
||||||
import com.vitorpamplona.amethyst.commons.tor.TorSettings
|
import com.vitorpamplona.amethyst.commons.tor.TorSettings
|
||||||
import com.vitorpamplona.amethyst.commons.ui.screen.UiSettingsState
|
|
||||||
import com.vitorpamplona.amethyst.connectedApps.DataStoreNostrSignerPermissionStore
|
import com.vitorpamplona.amethyst.connectedApps.DataStoreNostrSignerPermissionStore
|
||||||
import com.vitorpamplona.amethyst.connectedApps.nip46.DataStoreNip46ClientStore
|
import com.vitorpamplona.amethyst.connectedApps.nip46.DataStoreNip46ClientStore
|
||||||
import com.vitorpamplona.amethyst.model.Account
|
import com.vitorpamplona.amethyst.model.Account
|
||||||
|
|||||||
-2
@@ -39,7 +39,6 @@ import com.vitorpamplona.amethyst.commons.resources.relay_auth_purpose_read_outb
|
|||||||
import com.vitorpamplona.amethyst.commons.resources.relay_auth_purpose_read_venue
|
import com.vitorpamplona.amethyst.commons.resources.relay_auth_purpose_read_venue
|
||||||
import com.vitorpamplona.amethyst.commons.resources.relay_auth_purpose_send_dm
|
import com.vitorpamplona.amethyst.commons.resources.relay_auth_purpose_send_dm
|
||||||
import com.vitorpamplona.amethyst.commons.resources.relay_auth_purpose_thread
|
import com.vitorpamplona.amethyst.commons.resources.relay_auth_purpose_thread
|
||||||
import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel
|
|
||||||
import com.vitorpamplona.quartz.nip01Core.core.HexKey
|
import com.vitorpamplona.quartz.nip01Core.core.HexKey
|
||||||
import org.jetbrains.compose.resources.StringResource
|
import org.jetbrains.compose.resources.StringResource
|
||||||
|
|
||||||
@@ -51,7 +50,6 @@ import org.jetbrains.compose.resources.StringResource
|
|||||||
@Composable
|
@Composable
|
||||||
internal fun LoadRelayAuthUser(
|
internal fun LoadRelayAuthUser(
|
||||||
pubkey: HexKey,
|
pubkey: HexKey,
|
||||||
accountViewModel: AccountViewModel,
|
|
||||||
content: @Composable (User?) -> Unit,
|
content: @Composable (User?) -> Unit,
|
||||||
) {
|
) {
|
||||||
var user by remember(pubkey) { mutableStateOf(LocalCache.getUserIfExists(pubkey)) }
|
var user by remember(pubkey) { mutableStateOf(LocalCache.getUserIfExists(pubkey)) }
|
||||||
|
|||||||
+4
-3
@@ -99,6 +99,7 @@ import com.vitorpamplona.amethyst.commons.resources.relay_auth_why_thread
|
|||||||
import com.vitorpamplona.amethyst.commons.resources.relay_auth_why_thread_with
|
import com.vitorpamplona.amethyst.commons.resources.relay_auth_why_thread_with
|
||||||
import com.vitorpamplona.amethyst.commons.ui.components.RobohashFallbackAsyncImage
|
import com.vitorpamplona.amethyst.commons.ui.components.RobohashFallbackAsyncImage
|
||||||
import com.vitorpamplona.amethyst.commons.ui.pluralStringRes
|
import com.vitorpamplona.amethyst.commons.ui.pluralStringRes
|
||||||
|
import com.vitorpamplona.amethyst.commons.ui.screen.LocalDisplaySettings
|
||||||
import com.vitorpamplona.amethyst.commons.ui.stringRes
|
import com.vitorpamplona.amethyst.commons.ui.stringRes
|
||||||
import com.vitorpamplona.amethyst.commons.ui.theme.RelayIconFilter
|
import com.vitorpamplona.amethyst.commons.ui.theme.RelayIconFilter
|
||||||
import com.vitorpamplona.amethyst.model.nip11RelayInfo.loadRelayInfo
|
import com.vitorpamplona.amethyst.model.nip11RelayInfo.loadRelayInfo
|
||||||
@@ -404,8 +405,8 @@ private fun RelayHeader(
|
|||||||
contentDescription = null,
|
contentDescription = null,
|
||||||
colorFilter = RelayIconFilter,
|
colorFilter = RelayIconFilter,
|
||||||
modifier = Modifier.size(34.dp).clip(MaterialTheme.shapes.small),
|
modifier = Modifier.size(34.dp).clip(MaterialTheme.shapes.small),
|
||||||
loadProfilePicture = accountViewModel.settings.showProfilePictures(),
|
loadProfilePicture = LocalDisplaySettings.current.showProfilePictures,
|
||||||
loadRobohash = accountViewModel.settings.isNotPerformanceMode(),
|
loadRobohash = LocalDisplaySettings.current.loadRobohash,
|
||||||
)
|
)
|
||||||
Column {
|
Column {
|
||||||
Text(
|
Text(
|
||||||
@@ -466,7 +467,7 @@ private fun ReasonSentence(
|
|||||||
InlineTextContent(
|
InlineTextContent(
|
||||||
Placeholder(22.sp, 22.sp, PlaceholderVerticalAlign.TextCenter),
|
Placeholder(22.sp, 22.sp, PlaceholderVerticalAlign.TextCenter),
|
||||||
) {
|
) {
|
||||||
LoadRelayAuthUser(face, accountViewModel) { user ->
|
LoadRelayAuthUser(face) { user ->
|
||||||
if (user != null) ClickableUserPicture(user, 20.dp, accountViewModel)
|
if (user != null) ClickableUserPicture(user, 20.dp, accountViewModel)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -193,7 +193,7 @@ fun PeerAvatarCell(
|
|||||||
horizontalAlignment = Alignment.CenterHorizontally,
|
horizontalAlignment = Alignment.CenterHorizontally,
|
||||||
verticalArrangement = Arrangement.Center,
|
verticalArrangement = Arrangement.Center,
|
||||||
) {
|
) {
|
||||||
LoadUser(baseUserHex = peerPubKey, accountViewModel = accountViewModel) { user ->
|
LoadUser(baseUserHex = peerPubKey) { user ->
|
||||||
if (user != null) {
|
if (user != null) {
|
||||||
ClickableUserPicture(
|
ClickableUserPicture(
|
||||||
baseUser = user,
|
baseUser = user,
|
||||||
@@ -235,7 +235,7 @@ fun GroupCallPictures(
|
|||||||
0 -> {}
|
0 -> {}
|
||||||
|
|
||||||
1 -> {
|
1 -> {
|
||||||
LoadUser(baseUserHex = userList[0], accountViewModel = accountViewModel) { user ->
|
LoadUser(baseUserHex = userList[0]) { user ->
|
||||||
if (user != null) {
|
if (user != null) {
|
||||||
ClickableUserPicture(
|
ClickableUserPicture(
|
||||||
baseUser = user,
|
baseUser = user,
|
||||||
@@ -350,7 +350,7 @@ fun GroupCallNames(
|
|||||||
0 -> {}
|
0 -> {}
|
||||||
|
|
||||||
1 -> {
|
1 -> {
|
||||||
LoadUser(baseUserHex = userList[0], accountViewModel = accountViewModel) { user ->
|
LoadUser(baseUserHex = userList[0]) { user ->
|
||||||
if (user != null) {
|
if (user != null) {
|
||||||
UsernameDisplay(
|
UsernameDisplay(
|
||||||
baseUser = user,
|
baseUser = user,
|
||||||
@@ -378,7 +378,7 @@ fun GroupCallNames(
|
|||||||
color = textColor,
|
color = textColor,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
LoadUser(baseUserHex = userList[i], accountViewModel = accountViewModel) { user ->
|
LoadUser(baseUserHex = userList[i]) { user ->
|
||||||
if (user != null) {
|
if (user != null) {
|
||||||
UsernameDisplay(
|
UsernameDisplay(
|
||||||
baseUser = user,
|
baseUser = user,
|
||||||
|
|||||||
@@ -147,7 +147,7 @@ fun DisplayEvent(
|
|||||||
accountViewModel: AccountViewModel,
|
accountViewModel: AccountViewModel,
|
||||||
nav: INav,
|
nav: INav,
|
||||||
) {
|
) {
|
||||||
LoadNote(hex, accountViewModel) {
|
LoadNote(hex) {
|
||||||
if (it != null) {
|
if (it != null) {
|
||||||
DisplayNoteLink(it, hex, additionalChars, accountViewModel, nav)
|
DisplayNoteLink(it, hex, additionalChars, accountViewModel, nav)
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
+3
-2
@@ -51,6 +51,7 @@ import com.vitorpamplona.amethyst.commons.resources.concord_invite_card_join
|
|||||||
import com.vitorpamplona.amethyst.commons.resources.concord_invite_card_subtitle
|
import com.vitorpamplona.amethyst.commons.resources.concord_invite_card_subtitle
|
||||||
import com.vitorpamplona.amethyst.commons.ui.components.RobohashFallbackAsyncImage
|
import com.vitorpamplona.amethyst.commons.ui.components.RobohashFallbackAsyncImage
|
||||||
import com.vitorpamplona.amethyst.commons.ui.navigation.navs.INav
|
import com.vitorpamplona.amethyst.commons.ui.navigation.navs.INav
|
||||||
|
import com.vitorpamplona.amethyst.commons.ui.screen.LocalDisplaySettings
|
||||||
import com.vitorpamplona.amethyst.commons.ui.stringRes
|
import com.vitorpamplona.amethyst.commons.ui.stringRes
|
||||||
import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel
|
import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel
|
||||||
import com.vitorpamplona.quartz.concord.cord05Invites.CommunityInvite
|
import com.vitorpamplona.quartz.concord.cord05Invites.CommunityInvite
|
||||||
@@ -139,8 +140,8 @@ fun ConcordInvitePreviewRow(
|
|||||||
.size(52.dp)
|
.size(52.dp)
|
||||||
.clip(CircleShape)
|
.clip(CircleShape)
|
||||||
.border(1.5.dp, MaterialTheme.colorScheme.primary.copy(alpha = 0.35f), CircleShape),
|
.border(1.5.dp, MaterialTheme.colorScheme.primary.copy(alpha = 0.35f), CircleShape),
|
||||||
loadProfilePicture = accountViewModel.settings.showProfilePictures(),
|
loadProfilePicture = LocalDisplaySettings.current.showProfilePictures,
|
||||||
loadRobohash = accountViewModel.settings.isNotPerformanceMode(),
|
loadRobohash = LocalDisplaySettings.current.loadRobohash,
|
||||||
autoPlayGif = autoPlayGif,
|
autoPlayGif = autoPlayGif,
|
||||||
)
|
)
|
||||||
Column(Modifier.weight(1f)) {
|
Column(Modifier.weight(1f)) {
|
||||||
|
|||||||
@@ -56,6 +56,7 @@ import com.vitorpamplona.amethyst.commons.resources.relay_group_open
|
|||||||
import com.vitorpamplona.amethyst.commons.ui.components.RobohashFallbackAsyncImage
|
import com.vitorpamplona.amethyst.commons.ui.components.RobohashFallbackAsyncImage
|
||||||
import com.vitorpamplona.amethyst.commons.ui.navigation.navs.INav
|
import com.vitorpamplona.amethyst.commons.ui.navigation.navs.INav
|
||||||
import com.vitorpamplona.amethyst.commons.ui.pluralStringRes
|
import com.vitorpamplona.amethyst.commons.ui.pluralStringRes
|
||||||
|
import com.vitorpamplona.amethyst.commons.ui.screen.LocalDisplaySettings
|
||||||
import com.vitorpamplona.amethyst.commons.ui.stringRes
|
import com.vitorpamplona.amethyst.commons.ui.stringRes
|
||||||
import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel
|
import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel
|
||||||
import com.vitorpamplona.amethyst.ui.screen.loggedIn.chats.publicChannels.relayGroup.LoadRelayGroupChannel
|
import com.vitorpamplona.amethyst.ui.screen.loggedIn.chats.publicChannels.relayGroup.LoadRelayGroupChannel
|
||||||
@@ -86,7 +87,7 @@ fun RelayGroupCard(
|
|||||||
|
|
||||||
val groupId = remember(invite) { invite.toGroupId() }
|
val groupId = remember(invite) { invite.toGroupId() }
|
||||||
|
|
||||||
LoadRelayGroupChannel(groupId, accountViewModel) { channel ->
|
LoadRelayGroupChannel(groupId) { channel ->
|
||||||
RelayGroupCardContent(channel, invite.code, accountViewModel, nav)
|
RelayGroupCardContent(channel, invite.code, accountViewModel, nav)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -148,8 +149,8 @@ private fun RelayGroupCardContent(
|
|||||||
.size(52.dp)
|
.size(52.dp)
|
||||||
.clip(CircleShape)
|
.clip(CircleShape)
|
||||||
.border(1.5.dp, MaterialTheme.colorScheme.primary.copy(alpha = 0.35f), CircleShape),
|
.border(1.5.dp, MaterialTheme.colorScheme.primary.copy(alpha = 0.35f), CircleShape),
|
||||||
loadProfilePicture = accountViewModel.settings.showProfilePictures(),
|
loadProfilePicture = LocalDisplaySettings.current.showProfilePictures,
|
||||||
loadRobohash = accountViewModel.settings.isNotPerformanceMode(),
|
loadRobohash = LocalDisplaySettings.current.loadRobohash,
|
||||||
autoPlayGif = autoPlayGif,
|
autoPlayGif = autoPlayGif,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -862,7 +862,7 @@ fun TagLink(
|
|||||||
accountViewModel: AccountViewModel,
|
accountViewModel: AccountViewModel,
|
||||||
nav: INav,
|
nav: INav,
|
||||||
) {
|
) {
|
||||||
LoadUser(baseUserHex = word.hex, accountViewModel) {
|
LoadUser(baseUserHex = word.hex) {
|
||||||
if (it == null) {
|
if (it == null) {
|
||||||
Text(text = word.segmentText)
|
Text(text = word.segmentText)
|
||||||
} else {
|
} else {
|
||||||
@@ -879,7 +879,6 @@ fun TagLink(
|
|||||||
@Composable
|
@Composable
|
||||||
fun LoadNote(
|
fun LoadNote(
|
||||||
baseNoteHex: String,
|
baseNoteHex: String,
|
||||||
accountViewModel: AccountViewModel,
|
|
||||||
content: @Composable (Note?) -> Unit,
|
content: @Composable (Note?) -> Unit,
|
||||||
) {
|
) {
|
||||||
var note by
|
var note by
|
||||||
@@ -903,7 +902,7 @@ fun TagLink(
|
|||||||
accountViewModel: AccountViewModel,
|
accountViewModel: AccountViewModel,
|
||||||
nav: INav,
|
nav: INav,
|
||||||
) {
|
) {
|
||||||
LoadNote(baseNoteHex = word.hex, accountViewModel) {
|
LoadNote(baseNoteHex = word.hex) {
|
||||||
if (it == null) {
|
if (it == null) {
|
||||||
Text(text = remember { word.segmentText.toShortDisplay() })
|
Text(text = remember { word.segmentText.toShortDisplay() })
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
+3
-2
@@ -42,6 +42,7 @@ import com.vitorpamplona.amethyst.commons.model.nip29RelayGroups.RelayGroupChann
|
|||||||
import com.vitorpamplona.amethyst.commons.resources.Res
|
import com.vitorpamplona.amethyst.commons.resources.Res
|
||||||
import com.vitorpamplona.amethyst.commons.resources.concord_home_title
|
import com.vitorpamplona.amethyst.commons.resources.concord_home_title
|
||||||
import com.vitorpamplona.amethyst.commons.ui.components.RobohashFallbackAsyncImage
|
import com.vitorpamplona.amethyst.commons.ui.components.RobohashFallbackAsyncImage
|
||||||
|
import com.vitorpamplona.amethyst.commons.ui.screen.LocalDisplaySettings
|
||||||
import com.vitorpamplona.amethyst.commons.ui.stringRes
|
import com.vitorpamplona.amethyst.commons.ui.stringRes
|
||||||
import com.vitorpamplona.amethyst.model.nip11RelayInfo.loadRelayInfo
|
import com.vitorpamplona.amethyst.model.nip11RelayInfo.loadRelayInfo
|
||||||
import com.vitorpamplona.amethyst.service.relayClient.reqCommand.channel.ChannelFinderFilterAssemblerSubscription
|
import com.vitorpamplona.amethyst.service.relayClient.reqCommand.channel.ChannelFinderFilterAssemblerSubscription
|
||||||
@@ -279,8 +280,8 @@ fun GroupEntryAvatar(
|
|||||||
model = display.model,
|
model = display.model,
|
||||||
contentDescription = display.label,
|
contentDescription = display.label,
|
||||||
modifier = Modifier.size(size).clip(CircleShape),
|
modifier = Modifier.size(size).clip(CircleShape),
|
||||||
loadProfilePicture = accountViewModel.settings.showProfilePictures(),
|
loadProfilePicture = LocalDisplaySettings.current.showProfilePictures,
|
||||||
loadRobohash = accountViewModel.settings.isNotPerformanceMode(),
|
loadRobohash = LocalDisplaySettings.current.loadRobohash,
|
||||||
autoPlayGif = false,
|
autoPlayGif = false,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-2
@@ -75,6 +75,7 @@ import com.vitorpamplona.amethyst.commons.ui.components.RobohashFallbackAsyncIma
|
|||||||
import com.vitorpamplona.amethyst.commons.ui.loadPluralStringRes
|
import com.vitorpamplona.amethyst.commons.ui.loadPluralStringRes
|
||||||
import com.vitorpamplona.amethyst.commons.ui.pluralStringRes
|
import com.vitorpamplona.amethyst.commons.ui.pluralStringRes
|
||||||
import com.vitorpamplona.amethyst.commons.ui.richtext.CreateTextWithEmoji
|
import com.vitorpamplona.amethyst.commons.ui.richtext.CreateTextWithEmoji
|
||||||
|
import com.vitorpamplona.amethyst.commons.ui.screen.LocalDisplaySettings
|
||||||
import com.vitorpamplona.amethyst.commons.ui.stringRes
|
import com.vitorpamplona.amethyst.commons.ui.stringRes
|
||||||
import com.vitorpamplona.amethyst.commons.ui.theme.AccountPictureModifier
|
import com.vitorpamplona.amethyst.commons.ui.theme.AccountPictureModifier
|
||||||
import com.vitorpamplona.amethyst.commons.ui.theme.Size10dp
|
import com.vitorpamplona.amethyst.commons.ui.theme.Size10dp
|
||||||
@@ -238,8 +239,8 @@ private fun AccountPicture(
|
|||||||
model = userInfo?.info?.profilePicture(),
|
model = userInfo?.info?.profilePicture(),
|
||||||
contentDescription = stringRes(Res.string.profile_image),
|
contentDescription = stringRes(Res.string.profile_image),
|
||||||
modifier = AccountPictureModifier,
|
modifier = AccountPictureModifier,
|
||||||
loadProfilePicture = accountViewModel.settings.showProfilePictures(),
|
loadProfilePicture = LocalDisplaySettings.current.showProfilePictures,
|
||||||
loadRobohash = accountViewModel.settings.isNotPerformanceMode(),
|
loadRobohash = LocalDisplaySettings.current.loadRobohash,
|
||||||
autoPlayGif =
|
autoPlayGif =
|
||||||
accountViewModel.settings.autoPlayVideosFlow
|
accountViewModel.settings.autoPlayVideosFlow
|
||||||
.collectAsStateWithLifecycle()
|
.collectAsStateWithLifecycle()
|
||||||
|
|||||||
+3
-2
@@ -121,6 +121,7 @@ import com.vitorpamplona.amethyst.commons.ui.components.RobohashFallbackAsyncIma
|
|||||||
import com.vitorpamplona.amethyst.commons.ui.navigation.navs.EmptyNav
|
import com.vitorpamplona.amethyst.commons.ui.navigation.navs.EmptyNav
|
||||||
import com.vitorpamplona.amethyst.commons.ui.navigation.navs.INav
|
import com.vitorpamplona.amethyst.commons.ui.navigation.navs.INav
|
||||||
import com.vitorpamplona.amethyst.commons.ui.richtext.CreateTextWithEmoji
|
import com.vitorpamplona.amethyst.commons.ui.richtext.CreateTextWithEmoji
|
||||||
|
import com.vitorpamplona.amethyst.commons.ui.screen.LocalDisplaySettings
|
||||||
import com.vitorpamplona.amethyst.commons.ui.stringRes
|
import com.vitorpamplona.amethyst.commons.ui.stringRes
|
||||||
import com.vitorpamplona.amethyst.commons.ui.theme.DividerThickness
|
import com.vitorpamplona.amethyst.commons.ui.theme.DividerThickness
|
||||||
import com.vitorpamplona.amethyst.commons.ui.theme.DoubleHorzSpacer
|
import com.vitorpamplona.amethyst.commons.ui.theme.DoubleHorzSpacer
|
||||||
@@ -315,8 +316,8 @@ fun ProfileContentTemplate(
|
|||||||
.clip(shape = CircleShape)
|
.clip(shape = CircleShape)
|
||||||
.border(3.dp, MaterialTheme.colorScheme.onBackground, CircleShape)
|
.border(3.dp, MaterialTheme.colorScheme.onBackground, CircleShape)
|
||||||
.clickable(onClick = onClick),
|
.clickable(onClick = onClick),
|
||||||
loadProfilePicture = accountViewModel.settings.showProfilePictures(),
|
loadProfilePicture = LocalDisplaySettings.current.showProfilePictures,
|
||||||
loadRobohash = accountViewModel.settings.isNotPerformanceMode(),
|
loadRobohash = LocalDisplaySettings.current.loadRobohash,
|
||||||
autoPlayGif =
|
autoPlayGif =
|
||||||
accountViewModel.settings.autoPlayVideosFlow
|
accountViewModel.settings.autoPlayVideosFlow
|
||||||
.collectAsStateWithLifecycle()
|
.collectAsStateWithLifecycle()
|
||||||
|
|||||||
+3
-2
@@ -42,6 +42,7 @@ import com.vitorpamplona.amethyst.commons.ui.navigation.navs.INav
|
|||||||
import com.vitorpamplona.amethyst.commons.ui.navigation.topbars.ShorterTopAppBar
|
import com.vitorpamplona.amethyst.commons.ui.navigation.topbars.ShorterTopAppBar
|
||||||
import com.vitorpamplona.amethyst.commons.ui.note.ArrowBackIcon
|
import com.vitorpamplona.amethyst.commons.ui.note.ArrowBackIcon
|
||||||
import com.vitorpamplona.amethyst.commons.ui.note.SearchIcon
|
import com.vitorpamplona.amethyst.commons.ui.note.SearchIcon
|
||||||
|
import com.vitorpamplona.amethyst.commons.ui.screen.LocalDisplaySettings
|
||||||
import com.vitorpamplona.amethyst.commons.ui.stringRes
|
import com.vitorpamplona.amethyst.commons.ui.stringRes
|
||||||
import com.vitorpamplona.amethyst.commons.ui.theme.HeaderPictureModifier
|
import com.vitorpamplona.amethyst.commons.ui.theme.HeaderPictureModifier
|
||||||
import com.vitorpamplona.amethyst.commons.ui.theme.Size22Modifier
|
import com.vitorpamplona.amethyst.commons.ui.theme.Size22Modifier
|
||||||
@@ -142,8 +143,8 @@ internal fun LoggedInUserPictureDrawer(
|
|||||||
contentDescription = stringRes(id = Res.string.your_profile_image),
|
contentDescription = stringRes(id = Res.string.your_profile_image),
|
||||||
modifier = HeaderPictureModifier,
|
modifier = HeaderPictureModifier,
|
||||||
contentScale = ContentScale.Crop,
|
contentScale = ContentScale.Crop,
|
||||||
loadProfilePicture = accountViewModel.settings.showProfilePictures(),
|
loadProfilePicture = LocalDisplaySettings.current.showProfilePictures,
|
||||||
loadRobohash = accountViewModel.settings.isNotPerformanceMode(),
|
loadRobohash = LocalDisplaySettings.current.loadRobohash,
|
||||||
autoPlayGif =
|
autoPlayGif =
|
||||||
accountViewModel.settings.autoPlayVideosFlow
|
accountViewModel.settings.autoPlayVideosFlow
|
||||||
.collectAsStateWithLifecycle()
|
.collectAsStateWithLifecycle()
|
||||||
|
|||||||
@@ -92,7 +92,6 @@ fun LoadDecryptedContentOrNull(
|
|||||||
@Composable
|
@Composable
|
||||||
fun LoadAddressableNote(
|
fun LoadAddressableNote(
|
||||||
address: Address,
|
address: Address,
|
||||||
accountViewModel: AccountViewModel,
|
|
||||||
content: @Composable (AddressableNote?) -> Unit,
|
content: @Composable (AddressableNote?) -> Unit,
|
||||||
) {
|
) {
|
||||||
val note by produceState(
|
val note by produceState(
|
||||||
@@ -150,7 +149,6 @@ fun LoadOts(
|
|||||||
@Composable
|
@Composable
|
||||||
fun LoadPublicChatChannel(
|
fun LoadPublicChatChannel(
|
||||||
id: String,
|
id: String,
|
||||||
accountViewModel: AccountViewModel,
|
|
||||||
content: @Composable (PublicChatChannel) -> Unit,
|
content: @Composable (PublicChatChannel) -> Unit,
|
||||||
) {
|
) {
|
||||||
val channel by produceStateIfNotNull(LocalCache.getPublicChatChannelIfExists(id), id) {
|
val channel by produceStateIfNotNull(LocalCache.getPublicChatChannelIfExists(id), id) {
|
||||||
@@ -163,7 +161,6 @@ fun LoadPublicChatChannel(
|
|||||||
@Composable
|
@Composable
|
||||||
fun LoadEphemeralChatChannel(
|
fun LoadEphemeralChatChannel(
|
||||||
id: RoomId,
|
id: RoomId,
|
||||||
accountViewModel: AccountViewModel,
|
|
||||||
content: @Composable (EphemeralChatChannel) -> Unit,
|
content: @Composable (EphemeralChatChannel) -> Unit,
|
||||||
) {
|
) {
|
||||||
val channel =
|
val channel =
|
||||||
@@ -177,7 +174,6 @@ fun LoadEphemeralChatChannel(
|
|||||||
@Composable
|
@Composable
|
||||||
fun LoadLiveActivityChannel(
|
fun LoadLiveActivityChannel(
|
||||||
id: Address,
|
id: Address,
|
||||||
accountViewModel: AccountViewModel,
|
|
||||||
content: @Composable (LiveActivitiesChannel) -> Unit,
|
content: @Composable (LiveActivitiesChannel) -> Unit,
|
||||||
) {
|
) {
|
||||||
val channel =
|
val channel =
|
||||||
|
|||||||
@@ -87,6 +87,7 @@ import com.vitorpamplona.amethyst.commons.ui.note.RepostedIcon
|
|||||||
import com.vitorpamplona.amethyst.commons.ui.note.ScoreTagSmall
|
import com.vitorpamplona.amethyst.commons.ui.note.ScoreTagSmall
|
||||||
import com.vitorpamplona.amethyst.commons.ui.note.ZappedIcon
|
import com.vitorpamplona.amethyst.commons.ui.note.ZappedIcon
|
||||||
import com.vitorpamplona.amethyst.commons.ui.richtext.InLineIconRenderer
|
import com.vitorpamplona.amethyst.commons.ui.richtext.InLineIconRenderer
|
||||||
|
import com.vitorpamplona.amethyst.commons.ui.screen.LocalDisplaySettings
|
||||||
import com.vitorpamplona.amethyst.commons.ui.stringRes
|
import com.vitorpamplona.amethyst.commons.ui.stringRes
|
||||||
import com.vitorpamplona.amethyst.commons.ui.theme.BitcoinOrange
|
import com.vitorpamplona.amethyst.commons.ui.theme.BitcoinOrange
|
||||||
import com.vitorpamplona.amethyst.commons.ui.theme.HalfTopPadding
|
import com.vitorpamplona.amethyst.commons.ui.theme.HalfTopPadding
|
||||||
@@ -806,8 +807,8 @@ fun WatchUserMetadataAndFollowsAndRenderUserProfilePicture(
|
|||||||
contentDescription = stringRes(id = Res.string.profile_image),
|
contentDescription = stringRes(id = Res.string.profile_image),
|
||||||
modifier = MaterialTheme.colorScheme.profile35dpModifier,
|
modifier = MaterialTheme.colorScheme.profile35dpModifier,
|
||||||
contentScale = ContentScale.Crop,
|
contentScale = ContentScale.Crop,
|
||||||
loadProfilePicture = accountViewModel.settings.showProfilePictures(),
|
loadProfilePicture = LocalDisplaySettings.current.showProfilePictures,
|
||||||
loadRobohash = accountViewModel.settings.isNotPerformanceMode(),
|
loadRobohash = LocalDisplaySettings.current.loadRobohash,
|
||||||
autoPlayGif = autoPlayGif,
|
autoPlayGif = autoPlayGif,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -315,7 +315,7 @@ fun DisplayStatusInner(
|
|||||||
}
|
}
|
||||||
|
|
||||||
nostrATag != null -> {
|
nostrATag != null -> {
|
||||||
LoadAddressableNote(nostrATag, accountViewModel) { note ->
|
LoadAddressableNote(nostrATag) { note ->
|
||||||
if (note != null) {
|
if (note != null) {
|
||||||
Spacer(modifier = StdHorzSpacer)
|
Spacer(modifier = StdHorzSpacer)
|
||||||
IconButton(
|
IconButton(
|
||||||
@@ -339,7 +339,7 @@ fun DisplayStatusInner(
|
|||||||
}
|
}
|
||||||
|
|
||||||
nostrETag != null -> {
|
nostrETag != null -> {
|
||||||
LoadNote(baseNoteHex = nostrETag.eventId, accountViewModel) {
|
LoadNote(baseNoteHex = nostrETag.eventId) {
|
||||||
if (it != null) {
|
if (it != null) {
|
||||||
Spacer(modifier = StdHorzSpacer)
|
Spacer(modifier = StdHorzSpacer)
|
||||||
IconButton(
|
IconButton(
|
||||||
@@ -363,7 +363,7 @@ fun DisplayStatusInner(
|
|||||||
}
|
}
|
||||||
|
|
||||||
nostrPTag != null -> {
|
nostrPTag != null -> {
|
||||||
LoadUser(baseUserHex = nostrPTag, accountViewModel) { user ->
|
LoadUser(baseUserHex = nostrPTag) { user ->
|
||||||
if (user != null) {
|
if (user != null) {
|
||||||
Spacer(modifier = StdHorzSpacer)
|
Spacer(modifier = StdHorzSpacer)
|
||||||
IconButton(
|
IconButton(
|
||||||
|
|||||||
@@ -96,6 +96,7 @@ import com.vitorpamplona.amethyst.commons.ui.note.RenderCashuMint
|
|||||||
import com.vitorpamplona.amethyst.commons.ui.note.RenderFedimint
|
import com.vitorpamplona.amethyst.commons.ui.note.RenderFedimint
|
||||||
import com.vitorpamplona.amethyst.commons.ui.note.RenderMintRecommendation
|
import com.vitorpamplona.amethyst.commons.ui.note.RenderMintRecommendation
|
||||||
import com.vitorpamplona.amethyst.commons.ui.note.elements.StaleRelayHint
|
import com.vitorpamplona.amethyst.commons.ui.note.elements.StaleRelayHint
|
||||||
|
import com.vitorpamplona.amethyst.commons.ui.screen.LocalDisplaySettings
|
||||||
import com.vitorpamplona.amethyst.commons.ui.state.produceCachedStateAsync
|
import com.vitorpamplona.amethyst.commons.ui.state.produceCachedStateAsync
|
||||||
import com.vitorpamplona.amethyst.commons.ui.stringRes
|
import com.vitorpamplona.amethyst.commons.ui.stringRes
|
||||||
import com.vitorpamplona.amethyst.commons.ui.theme.DoubleVertSpacer
|
import com.vitorpamplona.amethyst.commons.ui.theme.DoubleVertSpacer
|
||||||
@@ -922,7 +923,7 @@ private fun RenderApprovalIfNeeded(
|
|||||||
baseNote.event?.communityAddress()
|
baseNote.event?.communityAddress()
|
||||||
}
|
}
|
||||||
communityAddress?.let {
|
communityAddress?.let {
|
||||||
LoadAddressableNote(it, accountViewModel) { community ->
|
LoadAddressableNote(it) { community ->
|
||||||
if (community != null) {
|
if (community != null) {
|
||||||
val showApproveButton by observeCommunityApprovalNeedStatus(baseNote, community, accountViewModel)
|
val showApproveButton by observeCommunityApprovalNeedStatus(baseNote, community, accountViewModel)
|
||||||
if (showApproveButton == true) {
|
if (showApproveButton == true) {
|
||||||
@@ -2427,7 +2428,7 @@ fun RenderAuthorImages(
|
|||||||
if (noteEvent is ChannelMessageEvent) {
|
if (noteEvent is ChannelMessageEvent) {
|
||||||
val baseChannelHex = noteEvent.channelId()
|
val baseChannelHex = noteEvent.channelId()
|
||||||
if (baseChannelHex != null) {
|
if (baseChannelHex != null) {
|
||||||
LoadPublicChatChannel(baseChannelHex, accountViewModel) { channel ->
|
LoadPublicChatChannel(baseChannelHex) { channel ->
|
||||||
ChannelNotePicture(
|
ChannelNotePicture(
|
||||||
channel,
|
channel,
|
||||||
accountViewModel,
|
accountViewModel,
|
||||||
@@ -2449,8 +2450,8 @@ private fun ChannelNotePicture(
|
|||||||
model = model,
|
model = model,
|
||||||
contentDescription = stringRes(Res.string.group_picture),
|
contentDescription = stringRes(Res.string.group_picture),
|
||||||
modifier = MaterialTheme.colorScheme.channelNotePictureModifier,
|
modifier = MaterialTheme.colorScheme.channelNotePictureModifier,
|
||||||
loadProfilePicture = accountViewModel.settings.showProfilePictures(),
|
loadProfilePicture = LocalDisplaySettings.current.showProfilePictures,
|
||||||
loadRobohash = accountViewModel.settings.isNotPerformanceMode(),
|
loadRobohash = LocalDisplaySettings.current.loadRobohash,
|
||||||
autoPlayGif =
|
autoPlayGif =
|
||||||
accountViewModel.settings.autoPlayVideosFlow
|
accountViewModel.settings.autoPlayVideosFlow
|
||||||
.collectAsStateWithLifecycle()
|
.collectAsStateWithLifecycle()
|
||||||
|
|||||||
@@ -428,7 +428,7 @@ fun PayReaction(
|
|||||||
val authorPubkey = baseNote.author?.pubkeyHex ?: return
|
val authorPubkey = baseNote.author?.pubkeyHex ?: return
|
||||||
val address = remember(authorPubkey) { PaymentTargetsEvent.createAddress(authorPubkey) }
|
val address = remember(authorPubkey) { PaymentTargetsEvent.createAddress(authorPubkey) }
|
||||||
|
|
||||||
LoadAddressableNote(address, accountViewModel) { note ->
|
LoadAddressableNote(address) { note ->
|
||||||
var expanded by remember { mutableStateOf(false) }
|
var expanded by remember { mutableStateOf(false) }
|
||||||
|
|
||||||
ClickableBox(
|
ClickableBox(
|
||||||
|
|||||||
@@ -58,6 +58,7 @@ import com.vitorpamplona.amethyst.commons.ui.components.ClickableBox
|
|||||||
import com.vitorpamplona.amethyst.commons.ui.components.RobohashFallbackAsyncImage
|
import com.vitorpamplona.amethyst.commons.ui.components.RobohashFallbackAsyncImage
|
||||||
import com.vitorpamplona.amethyst.commons.ui.components.util.setText
|
import com.vitorpamplona.amethyst.commons.ui.components.util.setText
|
||||||
import com.vitorpamplona.amethyst.commons.ui.navigation.navs.INav
|
import com.vitorpamplona.amethyst.commons.ui.navigation.navs.INav
|
||||||
|
import com.vitorpamplona.amethyst.commons.ui.screen.LocalDisplaySettings
|
||||||
import com.vitorpamplona.amethyst.commons.ui.stringRes
|
import com.vitorpamplona.amethyst.commons.ui.stringRes
|
||||||
import com.vitorpamplona.amethyst.commons.ui.theme.LargeRelayIconModifier
|
import com.vitorpamplona.amethyst.commons.ui.theme.LargeRelayIconModifier
|
||||||
import com.vitorpamplona.amethyst.commons.ui.theme.RelayIconFilter
|
import com.vitorpamplona.amethyst.commons.ui.theme.RelayIconFilter
|
||||||
@@ -161,9 +162,9 @@ fun RenderRelay(
|
|||||||
RenderRelayIcon(
|
RenderRelayIcon(
|
||||||
displayUrl = relayInfo.id ?: relay.url,
|
displayUrl = relayInfo.id ?: relay.url,
|
||||||
iconUrl = relayInfo.icon,
|
iconUrl = relayInfo.icon,
|
||||||
loadProfilePicture = accountViewModel.settings.showProfilePictures(),
|
loadProfilePicture = LocalDisplaySettings.current.showProfilePictures,
|
||||||
pingInMs = 0,
|
pingInMs = 0,
|
||||||
loadRobohash = accountViewModel.settings.isNotPerformanceMode(),
|
loadRobohash = LocalDisplaySettings.current.loadRobohash,
|
||||||
iconModifier = iconModifier,
|
iconModifier = iconModifier,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-2
@@ -359,7 +359,6 @@ private fun EmojiSelector(
|
|||||||
) {
|
) {
|
||||||
LoadAddressableNote(
|
LoadAddressableNote(
|
||||||
accountViewModel.account.emoji.getEmojiPackSelectionAddress(),
|
accountViewModel.account.emoji.getEmojiPackSelectionAddress(),
|
||||||
accountViewModel,
|
|
||||||
) { emptyNote ->
|
) { emptyNote ->
|
||||||
emptyNote?.let { usersEmojiList ->
|
emptyNote?.let { usersEmojiList ->
|
||||||
val collections by observeNoteEventAndMapNotNull(usersEmojiList, accountViewModel) { event: EmojiPackSelectionEvent ->
|
val collections by observeNoteEventAndMapNotNull(usersEmojiList, accountViewModel) { event: EmojiPackSelectionEvent ->
|
||||||
@@ -387,7 +386,7 @@ fun EmojiCollectionGallery(
|
|||||||
state = listState,
|
state = listState,
|
||||||
) {
|
) {
|
||||||
itemsIndexed(emojiCollections, key = { _, item -> item }) { _, item ->
|
itemsIndexed(emojiCollections, key = { _, item -> item }) { _, item ->
|
||||||
LoadAddressableNote(item, accountViewModel) {
|
LoadAddressableNote(item) {
|
||||||
it?.let { WatchAndRenderNote(it, bgColor, accountViewModel, nav, onClick) }
|
it?.let { WatchAndRenderNote(it, bgColor, accountViewModel, nav, onClick) }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ import com.vitorpamplona.amethyst.commons.ui.components.UserAvatar
|
|||||||
import com.vitorpamplona.amethyst.commons.ui.navigation.navs.INav
|
import com.vitorpamplona.amethyst.commons.ui.navigation.navs.INav
|
||||||
import com.vitorpamplona.amethyst.commons.ui.note.FollowingIcon
|
import com.vitorpamplona.amethyst.commons.ui.note.FollowingIcon
|
||||||
import com.vitorpamplona.amethyst.commons.ui.note.ScoreTag
|
import com.vitorpamplona.amethyst.commons.ui.note.ScoreTag
|
||||||
|
import com.vitorpamplona.amethyst.commons.ui.screen.LocalDisplaySettings
|
||||||
import com.vitorpamplona.amethyst.commons.ui.stringRes
|
import com.vitorpamplona.amethyst.commons.ui.stringRes
|
||||||
import com.vitorpamplona.amethyst.commons.ui.theme.ThemeComparisonColumn
|
import com.vitorpamplona.amethyst.commons.ui.theme.ThemeComparisonColumn
|
||||||
import com.vitorpamplona.amethyst.service.relayClient.reqCommand.user.observeUserContactCardsScore
|
import com.vitorpamplona.amethyst.service.relayClient.reqCommand.user.observeUserContactCardsScore
|
||||||
@@ -105,7 +106,7 @@ fun DisplayBlankAuthor(
|
|||||||
robot = "authornotfound",
|
robot = "authornotfound",
|
||||||
contentDescription = stringRes(Res.string.unknown_author),
|
contentDescription = stringRes(Res.string.unknown_author),
|
||||||
modifier = nullModifier,
|
modifier = nullModifier,
|
||||||
loadRobohash = accountViewModel.settings.isNotPerformanceMode(),
|
loadRobohash = LocalDisplaySettings.current.loadRobohash,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -117,7 +118,7 @@ fun UserPicture(
|
|||||||
accountViewModel: AccountViewModel,
|
accountViewModel: AccountViewModel,
|
||||||
nav: INav,
|
nav: INav,
|
||||||
) {
|
) {
|
||||||
LoadUser(baseUserHex = userHex, accountViewModel) {
|
LoadUser(baseUserHex = userHex) {
|
||||||
if (it != null) {
|
if (it != null) {
|
||||||
UserPicture(
|
UserPicture(
|
||||||
user = it,
|
user = it,
|
||||||
@@ -241,7 +242,7 @@ fun NonClickableUserPictures(
|
|||||||
0 -> {}
|
0 -> {}
|
||||||
|
|
||||||
1 -> {
|
1 -> {
|
||||||
LoadUser(baseUserHex = userHexList.first(), accountViewModel) {
|
LoadUser(baseUserHex = userHexList.first()) {
|
||||||
it?.let { BaseUserPicture(it, size, accountViewModel, outerModifier = Modifier) }
|
it?.let { BaseUserPicture(it, size, accountViewModel, outerModifier = Modifier) }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -249,7 +250,7 @@ fun NonClickableUserPictures(
|
|||||||
2 -> {
|
2 -> {
|
||||||
val userList = userHexList
|
val userList = userHexList
|
||||||
|
|
||||||
LoadUser(baseUserHex = userList[0], accountViewModel) {
|
LoadUser(baseUserHex = userList[0]) {
|
||||||
it?.let {
|
it?.let {
|
||||||
BaseUserPicture(
|
BaseUserPicture(
|
||||||
it,
|
it,
|
||||||
@@ -259,7 +260,7 @@ fun NonClickableUserPictures(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
LoadUser(baseUserHex = userList[1], accountViewModel) {
|
LoadUser(baseUserHex = userList[1]) {
|
||||||
it?.let {
|
it?.let {
|
||||||
BaseUserPicture(
|
BaseUserPicture(
|
||||||
it,
|
it,
|
||||||
@@ -274,7 +275,7 @@ fun NonClickableUserPictures(
|
|||||||
3 -> {
|
3 -> {
|
||||||
val userList = userHexList
|
val userList = userHexList
|
||||||
|
|
||||||
LoadUser(baseUserHex = userList[0], accountViewModel) {
|
LoadUser(baseUserHex = userList[0]) {
|
||||||
it?.let {
|
it?.let {
|
||||||
BaseUserPicture(
|
BaseUserPicture(
|
||||||
it,
|
it,
|
||||||
@@ -284,7 +285,7 @@ fun NonClickableUserPictures(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
LoadUser(baseUserHex = userList[1], accountViewModel) {
|
LoadUser(baseUserHex = userList[1]) {
|
||||||
it?.let {
|
it?.let {
|
||||||
BaseUserPicture(
|
BaseUserPicture(
|
||||||
it,
|
it,
|
||||||
@@ -294,7 +295,7 @@ fun NonClickableUserPictures(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
LoadUser(baseUserHex = userList[2], accountViewModel) {
|
LoadUser(baseUserHex = userList[2]) {
|
||||||
it?.let {
|
it?.let {
|
||||||
BaseUserPicture(
|
BaseUserPicture(
|
||||||
it,
|
it,
|
||||||
@@ -309,7 +310,7 @@ fun NonClickableUserPictures(
|
|||||||
else -> {
|
else -> {
|
||||||
val userList = userHexList
|
val userList = userHexList
|
||||||
|
|
||||||
LoadUser(baseUserHex = userList[0], accountViewModel) {
|
LoadUser(baseUserHex = userList[0]) {
|
||||||
it?.let {
|
it?.let {
|
||||||
BaseUserPicture(
|
BaseUserPicture(
|
||||||
it,
|
it,
|
||||||
@@ -319,7 +320,7 @@ fun NonClickableUserPictures(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
LoadUser(baseUserHex = userList[1], accountViewModel) {
|
LoadUser(baseUserHex = userList[1]) {
|
||||||
it?.let {
|
it?.let {
|
||||||
BaseUserPicture(
|
BaseUserPicture(
|
||||||
it,
|
it,
|
||||||
@@ -329,7 +330,7 @@ fun NonClickableUserPictures(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
LoadUser(baseUserHex = userList[2], accountViewModel) {
|
LoadUser(baseUserHex = userList[2]) {
|
||||||
it?.let {
|
it?.let {
|
||||||
BaseUserPicture(
|
BaseUserPicture(
|
||||||
it,
|
it,
|
||||||
@@ -339,7 +340,7 @@ fun NonClickableUserPictures(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
LoadUser(baseUserHex = userList[3], accountViewModel) {
|
LoadUser(baseUserHex = userList[3]) {
|
||||||
it?.let {
|
it?.let {
|
||||||
BaseUserPicture(
|
BaseUserPicture(
|
||||||
it,
|
it,
|
||||||
@@ -392,7 +393,7 @@ fun BaseUserPicture(
|
|||||||
outerModifier: Modifier = Modifier.size(size),
|
outerModifier: Modifier = Modifier.size(size),
|
||||||
) {
|
) {
|
||||||
Box(outerModifier, contentAlignment = Alignment.TopEnd) {
|
Box(outerModifier, contentAlignment = Alignment.TopEnd) {
|
||||||
LoadUser(baseUserHex, accountViewModel) {
|
LoadUser(baseUserHex) {
|
||||||
if (it != null) {
|
if (it != null) {
|
||||||
ObserveAndDrawInnerUserPicture(it, size, accountViewModel, innerModifier)
|
ObserveAndDrawInnerUserPicture(it, size, accountViewModel, innerModifier)
|
||||||
|
|
||||||
|
|||||||
+1
-2
@@ -34,7 +34,6 @@ import kotlinx.collections.immutable.toImmutableList
|
|||||||
fun WatchAndLoadMyEmojiList(accountViewModel: AccountViewModel) {
|
fun WatchAndLoadMyEmojiList(accountViewModel: AccountViewModel) {
|
||||||
LoadAddressableNote(
|
LoadAddressableNote(
|
||||||
EmojiPackSelectionEvent.createAddress(accountViewModel.userProfile().pubkeyHex),
|
EmojiPackSelectionEvent.createAddress(accountViewModel.userProfile().pubkeyHex),
|
||||||
accountViewModel,
|
|
||||||
) { emptyNote ->
|
) { emptyNote ->
|
||||||
emptyNote?.let { usersEmojiList ->
|
emptyNote?.let { usersEmojiList ->
|
||||||
val collections by observeNoteEventAndMapNotNull(usersEmojiList, accountViewModel) { event: EmojiPackSelectionEvent ->
|
val collections by observeNoteEventAndMapNotNull(usersEmojiList, accountViewModel) { event: EmojiPackSelectionEvent ->
|
||||||
@@ -42,7 +41,7 @@ fun WatchAndLoadMyEmojiList(accountViewModel: AccountViewModel) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
collections?.forEach { address ->
|
collections?.forEach { address ->
|
||||||
LoadAddressableNote(address, accountViewModel) { note ->
|
LoadAddressableNote(address) { note ->
|
||||||
if (note != null) {
|
if (note != null) {
|
||||||
EventFinderFilterAssemblerSubscription(note, accountViewModel)
|
EventFinderFilterAssemblerSubscription(note, accountViewModel)
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -244,7 +244,7 @@ private fun OfferRecipientRow(
|
|||||||
accountViewModel: AccountViewModel,
|
accountViewModel: AccountViewModel,
|
||||||
nav: INav,
|
nav: INav,
|
||||||
) {
|
) {
|
||||||
LoadUser(baseUserHex = pubKey, accountViewModel) { user ->
|
LoadUser(baseUserHex = pubKey) { user ->
|
||||||
if (user != null) {
|
if (user != null) {
|
||||||
Row(
|
Row(
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
|
|||||||
-1
@@ -106,7 +106,6 @@ fun ObserveRelayListForDMs(
|
|||||||
) {
|
) {
|
||||||
LoadAddressableNote(
|
LoadAddressableNote(
|
||||||
ChatMessageRelayListEvent.createAddress(pubkey),
|
ChatMessageRelayListEvent.createAddress(pubkey),
|
||||||
accountViewModel,
|
|
||||||
) { relayList ->
|
) { relayList ->
|
||||||
if (relayList != null) {
|
if (relayList != null) {
|
||||||
val relayListEvent by observeNoteEvent<ChatMessageRelayListEvent>(relayList, accountViewModel)
|
val relayListEvent by observeNoteEvent<ChatMessageRelayListEvent>(relayList, accountViewModel)
|
||||||
|
|||||||
@@ -49,13 +49,13 @@ fun ShowForkInformation(
|
|||||||
val forkedAddress = remember(noteEvent) { noteEvent.forkFromAddress() }
|
val forkedAddress = remember(noteEvent) { noteEvent.forkFromAddress() }
|
||||||
val forkedEvent = remember(noteEvent) { noteEvent.forkFromVersion() }
|
val forkedEvent = remember(noteEvent) { noteEvent.forkFromVersion() }
|
||||||
if (forkedAddress != null) {
|
if (forkedAddress != null) {
|
||||||
LoadAddressableNote(forkedAddress, accountViewModel) { addressableNote ->
|
LoadAddressableNote(forkedAddress) { addressableNote ->
|
||||||
if (addressableNote != null) {
|
if (addressableNote != null) {
|
||||||
ForkMark(addressableNote, modifier, accountViewModel, nav)
|
ForkMark(addressableNote, modifier, accountViewModel, nav)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (forkedEvent != null) {
|
} else if (forkedEvent != null) {
|
||||||
LoadNote(forkedEvent, accountViewModel) { event ->
|
LoadNote(forkedEvent) { event ->
|
||||||
if (event != null) {
|
if (event != null) {
|
||||||
ForkMark(event, modifier, accountViewModel, nav)
|
ForkMark(event, modifier, accountViewModel, nav)
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -123,7 +123,7 @@ fun ShareNoteAsImageScreen(
|
|||||||
accountViewModel: AccountViewModel,
|
accountViewModel: AccountViewModel,
|
||||||
nav: INav,
|
nav: INav,
|
||||||
) {
|
) {
|
||||||
LoadNote(id, accountViewModel) { note ->
|
LoadNote(id) { note ->
|
||||||
if (note != null) {
|
if (note != null) {
|
||||||
ShareNoteAsImageScreen(note, accountViewModel, nav)
|
ShareNoteAsImageScreen(note, accountViewModel, nav)
|
||||||
}
|
}
|
||||||
@@ -142,7 +142,7 @@ fun ShareNoteAsImageFileScreen(
|
|||||||
accountViewModel: AccountViewModel,
|
accountViewModel: AccountViewModel,
|
||||||
nav: INav,
|
nav: INav,
|
||||||
) {
|
) {
|
||||||
LoadNote(id, accountViewModel) { note ->
|
LoadNote(id) { note ->
|
||||||
if (note != null) {
|
if (note != null) {
|
||||||
ShareNoteAsImageFileScreen(note, accountViewModel, nav)
|
ShareNoteAsImageFileScreen(note, accountViewModel, nav)
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -94,7 +94,7 @@ fun ShareNoteAsQrScreen(
|
|||||||
Scaffold(
|
Scaffold(
|
||||||
topBar = { TopBarWithBackButton(stringRes(Res.string.share_as_qr), nav) },
|
topBar = { TopBarWithBackButton(stringRes(Res.string.share_as_qr), nav) },
|
||||||
) { pad ->
|
) { pad ->
|
||||||
LoadNote(id, accountViewModel) { note ->
|
LoadNote(id) { note ->
|
||||||
if (note != null) {
|
if (note != null) {
|
||||||
ShareNoteAsQrScreenContent(note, accountViewModel, nav, pad)
|
ShareNoteAsQrScreenContent(note, accountViewModel, nav, pad)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -585,7 +585,7 @@ private fun RelatedEventRow(
|
|||||||
val address = remember(aTag) { Address(aTag.kind, aTag.pubKeyHex, aTag.dTag) }
|
val address = remember(aTag) { Address(aTag.kind, aTag.pubKeyHex, aTag.dTag) }
|
||||||
val shape = RoundedCornerShape(8.dp)
|
val shape = RoundedCornerShape(8.dp)
|
||||||
|
|
||||||
LoadAddressableNote(address, accountViewModel) { note ->
|
LoadAddressableNote(address) { note ->
|
||||||
if (note == null) return@LoadAddressableNote
|
if (note == null) return@LoadAddressableNote
|
||||||
|
|
||||||
val noteState by observeNote(note, accountViewModel)
|
val noteState by observeNote(note, accountViewModel)
|
||||||
@@ -709,7 +709,7 @@ fun ByAuthorChip(
|
|||||||
accountViewModel: AccountViewModel,
|
accountViewModel: AccountViewModel,
|
||||||
nav: INav,
|
nav: INav,
|
||||||
) {
|
) {
|
||||||
LoadUser(baseUserHex = authorHex, accountViewModel = accountViewModel) { author ->
|
LoadUser(baseUserHex = authorHex) { author ->
|
||||||
if (author == null) return@LoadUser
|
if (author == null) return@LoadUser
|
||||||
|
|
||||||
Surface(
|
Surface(
|
||||||
|
|||||||
+1
-1
@@ -85,7 +85,7 @@ fun RenderAppRecommendation(
|
|||||||
verticalArrangement = Arrangement.spacedBy(8.dp),
|
verticalArrangement = Arrangement.spacedBy(8.dp),
|
||||||
) {
|
) {
|
||||||
recommendations.forEach { recommendation ->
|
recommendations.forEach { recommendation ->
|
||||||
LoadAddressableNote(recommendation.address, accountViewModel) { appNote ->
|
LoadAddressableNote(recommendation.address) { appNote ->
|
||||||
appNote?.let {
|
appNote?.let {
|
||||||
if (it.event == null) {
|
if (it.event == null) {
|
||||||
EventFinderFilterAssemblerSubscription(it, accountViewModel)
|
EventFinderFilterAssemblerSubscription(it, accountViewModel)
|
||||||
|
|||||||
@@ -221,7 +221,7 @@ fun RenderAttestation(
|
|||||||
|
|
||||||
if (quotesLeft > 0) {
|
if (quotesLeft > 0) {
|
||||||
if (aboutAddress != null) {
|
if (aboutAddress != null) {
|
||||||
LoadAddressableNote(aboutAddress, accountViewModel) {
|
LoadAddressableNote(aboutAddress) {
|
||||||
if (it != null) {
|
if (it != null) {
|
||||||
Spacer(modifier = DoubleVertSpacer)
|
Spacer(modifier = DoubleVertSpacer)
|
||||||
NoteCompose(
|
NoteCompose(
|
||||||
@@ -238,7 +238,7 @@ fun RenderAttestation(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (aboutEvent != null) {
|
} else if (aboutEvent != null) {
|
||||||
LoadNote(aboutEvent, accountViewModel) {
|
LoadNote(aboutEvent) {
|
||||||
if (it != null) {
|
if (it != null) {
|
||||||
Spacer(modifier = DoubleVertSpacer)
|
Spacer(modifier = DoubleVertSpacer)
|
||||||
NoteCompose(
|
NoteCompose(
|
||||||
@@ -345,7 +345,7 @@ fun RenderAttestationRequest(
|
|||||||
if (quotesLeft > 0) {
|
if (quotesLeft > 0) {
|
||||||
when {
|
when {
|
||||||
aboutAddress != null -> {
|
aboutAddress != null -> {
|
||||||
LoadAddressableNote(aboutAddress, accountViewModel) {
|
LoadAddressableNote(aboutAddress) {
|
||||||
if (it != null) {
|
if (it != null) {
|
||||||
Spacer(modifier = DoubleVertSpacer)
|
Spacer(modifier = DoubleVertSpacer)
|
||||||
Text(
|
Text(
|
||||||
@@ -369,7 +369,7 @@ fun RenderAttestationRequest(
|
|||||||
}
|
}
|
||||||
|
|
||||||
aboutEvent != null -> {
|
aboutEvent != null -> {
|
||||||
LoadNote(aboutEvent, accountViewModel) {
|
LoadNote(aboutEvent) {
|
||||||
if (it != null) {
|
if (it != null) {
|
||||||
Spacer(modifier = DoubleVertSpacer)
|
Spacer(modifier = DoubleVertSpacer)
|
||||||
Text(
|
Text(
|
||||||
@@ -393,7 +393,7 @@ fun RenderAttestationRequest(
|
|||||||
}
|
}
|
||||||
|
|
||||||
aboutPubkey != null -> {
|
aboutPubkey != null -> {
|
||||||
LoadUser(aboutPubkey, accountViewModel) {
|
LoadUser(aboutPubkey) {
|
||||||
if (it != null) {
|
if (it != null) {
|
||||||
Spacer(modifier = DoubleVertSpacer)
|
Spacer(modifier = DoubleVertSpacer)
|
||||||
Text(
|
Text(
|
||||||
@@ -458,7 +458,7 @@ fun RenderAttestorRecommendation(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
LoadUser(aboutPubKey, accountViewModel) {
|
LoadUser(aboutPubKey) {
|
||||||
if (it != null) {
|
if (it != null) {
|
||||||
Spacer(modifier = DoubleVertSpacer)
|
Spacer(modifier = DoubleVertSpacer)
|
||||||
UserCompose(it, accountViewModel = accountViewModel, nav = nav)
|
UserCompose(it, accountViewModel = accountViewModel, nav = nav)
|
||||||
|
|||||||
+1
-1
@@ -73,7 +73,7 @@ private fun LoadAppointmentBehind(
|
|||||||
) {
|
) {
|
||||||
val address = remember(event) { event.calendarEventAddress() } ?: return
|
val address = remember(event) { event.calendarEventAddress() } ?: return
|
||||||
|
|
||||||
LoadAddressableNote(address, accountViewModel) { appointment ->
|
LoadAddressableNote(address) { appointment ->
|
||||||
if (appointment != null) {
|
if (appointment != null) {
|
||||||
EventFinderFilterAssemblerSubscription(appointment, accountViewModel)
|
EventFinderFilterAssemblerSubscription(appointment, accountViewModel)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ fun RenderChessGame(
|
|||||||
ChessGameViewer(
|
ChessGameViewer(
|
||||||
pgnContent = event.pgn(),
|
pgnContent = event.pgn(),
|
||||||
playerContent = { playerHex ->
|
playerContent = { playerHex ->
|
||||||
LoadUser(playerHex, accountViewModel) { user ->
|
LoadUser(playerHex) { user ->
|
||||||
if (user != null) {
|
if (user != null) {
|
||||||
UserChip(user = user, accountViewModel = accountViewModel, nav = nav)
|
UserChip(user = user, accountViewModel = accountViewModel, nav = nav)
|
||||||
} else {
|
} else {
|
||||||
@@ -196,7 +196,7 @@ fun RenderLiveChessChallenge(
|
|||||||
fontWeight = FontWeight.Bold,
|
fontWeight = FontWeight.Bold,
|
||||||
)
|
)
|
||||||
event.opponentPubkey()?.let { opponentHex ->
|
event.opponentPubkey()?.let { opponentHex ->
|
||||||
LoadUser(opponentHex, accountViewModel) { user ->
|
LoadUser(opponentHex) { user ->
|
||||||
if (user != null) {
|
if (user != null) {
|
||||||
UserChip(user = user, accountViewModel = accountViewModel, nav = nav)
|
UserChip(user = user, accountViewModel = accountViewModel, nav = nav)
|
||||||
}
|
}
|
||||||
@@ -313,7 +313,7 @@ fun RenderLiveChessGameEnd(
|
|||||||
)
|
)
|
||||||
|
|
||||||
event.opponentPubkey()?.let { opponentHex ->
|
event.opponentPubkey()?.let { opponentHex ->
|
||||||
LoadUser(opponentHex, accountViewModel) { user ->
|
LoadUser(opponentHex) { user ->
|
||||||
if (user != null) {
|
if (user != null) {
|
||||||
UserChip(user = user, accountViewModel = accountViewModel, nav = nav)
|
UserChip(user = user, accountViewModel = accountViewModel, nav = nav)
|
||||||
}
|
}
|
||||||
@@ -340,7 +340,7 @@ fun RenderLiveChessGameEnd(
|
|||||||
ChessGameViewer(
|
ChessGameViewer(
|
||||||
pgnContent = pgn,
|
pgnContent = pgn,
|
||||||
playerContent = { playerHex ->
|
playerContent = { playerHex ->
|
||||||
LoadUser(playerHex, accountViewModel) { user ->
|
LoadUser(playerHex) { user ->
|
||||||
if (user != null) {
|
if (user != null) {
|
||||||
UserChip(user = user, accountViewModel = accountViewModel, nav = nav)
|
UserChip(user = user, accountViewModel = accountViewModel, nav = nav)
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -79,6 +79,7 @@ import com.vitorpamplona.amethyst.commons.resources.quick_action_share
|
|||||||
import com.vitorpamplona.amethyst.commons.resources.quick_action_share_browser_link
|
import com.vitorpamplona.amethyst.commons.resources.quick_action_share_browser_link
|
||||||
import com.vitorpamplona.amethyst.commons.ui.components.RobohashFallbackAsyncImage
|
import com.vitorpamplona.amethyst.commons.ui.components.RobohashFallbackAsyncImage
|
||||||
import com.vitorpamplona.amethyst.commons.ui.navigation.navs.INav
|
import com.vitorpamplona.amethyst.commons.ui.navigation.navs.INav
|
||||||
|
import com.vitorpamplona.amethyst.commons.ui.screen.LocalDisplaySettings
|
||||||
import com.vitorpamplona.amethyst.commons.ui.stringRes
|
import com.vitorpamplona.amethyst.commons.ui.stringRes
|
||||||
import com.vitorpamplona.amethyst.commons.ui.theme.ButtonBorder
|
import com.vitorpamplona.amethyst.commons.ui.theme.ButtonBorder
|
||||||
import com.vitorpamplona.amethyst.commons.ui.theme.ButtonPadding
|
import com.vitorpamplona.amethyst.commons.ui.theme.ButtonPadding
|
||||||
@@ -338,8 +339,8 @@ fun ShortCommunityHeader(
|
|||||||
contentDescription = stringRes(Res.string.profile_image),
|
contentDescription = stringRes(Res.string.profile_image),
|
||||||
contentScale = ContentScale.Crop,
|
contentScale = ContentScale.Crop,
|
||||||
modifier = HeaderPictureModifier,
|
modifier = HeaderPictureModifier,
|
||||||
loadProfilePicture = accountViewModel.settings.showProfilePictures(),
|
loadProfilePicture = LocalDisplaySettings.current.showProfilePictures,
|
||||||
loadRobohash = accountViewModel.settings.isNotPerformanceMode(),
|
loadRobohash = LocalDisplaySettings.current.loadRobohash,
|
||||||
autoPlayGif =
|
autoPlayGif =
|
||||||
accountViewModel.settings.autoPlayVideosFlow
|
accountViewModel.settings.autoPlayVideosFlow
|
||||||
.collectAsStateWithLifecycle()
|
.collectAsStateWithLifecycle()
|
||||||
@@ -393,8 +394,8 @@ fun ShortCommunityHeaderNoActions(
|
|||||||
contentDescription = stringRes(Res.string.profile_image),
|
contentDescription = stringRes(Res.string.profile_image),
|
||||||
contentScale = ContentScale.Crop,
|
contentScale = ContentScale.Crop,
|
||||||
modifier = HeaderPictureModifier,
|
modifier = HeaderPictureModifier,
|
||||||
loadProfilePicture = accountViewModel.settings.showProfilePictures(),
|
loadProfilePicture = LocalDisplaySettings.current.showProfilePictures,
|
||||||
loadRobohash = accountViewModel.settings.isNotPerformanceMode(),
|
loadRobohash = LocalDisplaySettings.current.loadRobohash,
|
||||||
autoPlayGif =
|
autoPlayGif =
|
||||||
accountViewModel.settings.autoPlayVideosFlow
|
accountViewModel.settings.autoPlayVideosFlow
|
||||||
.collectAsStateWithLifecycle()
|
.collectAsStateWithLifecycle()
|
||||||
|
|||||||
@@ -182,7 +182,6 @@ private fun EmojiListOptions(
|
|||||||
) {
|
) {
|
||||||
LoadAddressableNote(
|
LoadAddressableNote(
|
||||||
accountViewModel.account.emoji.getEmojiPackSelectionAddress(),
|
accountViewModel.account.emoji.getEmojiPackSelectionAddress(),
|
||||||
accountViewModel,
|
|
||||||
) {
|
) {
|
||||||
it?.let { usersEmojiList ->
|
it?.let { usersEmojiList ->
|
||||||
val hasAddedThis by observeNoteAndMap(usersEmojiList, accountViewModel) {
|
val hasAddedThis by observeNoteAndMap(usersEmojiList, accountViewModel) {
|
||||||
|
|||||||
@@ -127,7 +127,7 @@ fun RenderEntityRating(
|
|||||||
|
|
||||||
Column(Modifier.fillMaxWidth()) {
|
Column(Modifier.fillMaxWidth()) {
|
||||||
if (targetAddress != null) {
|
if (targetAddress != null) {
|
||||||
LoadAddressableNote(targetAddress, accountViewModel) { targetNote ->
|
LoadAddressableNote(targetAddress) { targetNote ->
|
||||||
targetNote?.let {
|
targetNote?.let {
|
||||||
RatedPublicationCard(
|
RatedPublicationCard(
|
||||||
targetNote = it,
|
targetNote = it,
|
||||||
@@ -142,7 +142,7 @@ fun RenderEntityRating(
|
|||||||
// The spec's default mark is `event`, and such a rating names its target by event id
|
// The spec's default mark is `event`, and such a rating names its target by event id
|
||||||
// rather than by coordinate. Without this the card printed the raw 64-hex id as its
|
// rather than by coordinate. Without this the card printed the raw 64-hex id as its
|
||||||
// title, which tells a reader nothing about what was rated.
|
// title, which tells a reader nothing about what was rated.
|
||||||
LoadNote(targetEventId, accountViewModel) { targetNote ->
|
LoadNote(targetEventId) { targetNote ->
|
||||||
if (targetNote != null) {
|
if (targetNote != null) {
|
||||||
RatedNoteCard(targetNote, mark, accountViewModel, nav)
|
RatedNoteCard(targetNote, mark, accountViewModel, nav)
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ fun FileStorageHeaderDisplay(
|
|||||||
val eventHeader = (baseNote.event as? FileStorageHeaderEvent) ?: return
|
val eventHeader = (baseNote.event as? FileStorageHeaderEvent) ?: return
|
||||||
val dataEventId = eventHeader.dataEventId() ?: return
|
val dataEventId = eventHeader.dataEventId() ?: return
|
||||||
|
|
||||||
LoadNote(baseNoteHex = dataEventId, accountViewModel) { contentNote ->
|
LoadNote(baseNoteHex = dataEventId) { contentNote ->
|
||||||
if (contentNote != null) {
|
if (contentNote != null) {
|
||||||
ObserverAndRenderNIP95(baseNote, contentNote, roundedCorner, contentScale, accountViewModel)
|
ObserverAndRenderNIP95(baseNote, contentNote, roundedCorner, contentScale, accountViewModel)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -169,7 +169,7 @@ fun RenderGeocacheFoundLog(
|
|||||||
|
|
||||||
// Loaded even for an unverified log: the cache's name is what tells a reader in a feed what
|
// Loaded even for an unverified log: the cache's name is what tells a reader in a feed what
|
||||||
// was actually found, and "Found it!" on its own says nothing.
|
// was actually found, and "Found it!" on its own says nothing.
|
||||||
LoadAddressableNote(address, accountViewModel) { cacheNote ->
|
LoadAddressableNote(address) { cacheNote ->
|
||||||
if (cacheNote == null) {
|
if (cacheNote == null) {
|
||||||
GeocacheFoundLogCard(noteEvent, showImages, if (hasProof) FoundLogProof.UNKNOWN else FoundLogProof.NONE)
|
GeocacheFoundLogCard(noteEvent, showImages, if (hasProof) FoundLogProof.UNKNOWN else FoundLogProof.NONE)
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -451,7 +451,7 @@ private fun RenderGitPatchEvent(
|
|||||||
val repository = remember(noteEvent) { noteEvent.repositoryAddress() }
|
val repository = remember(noteEvent) { noteEvent.repositoryAddress() }
|
||||||
if (repository != null) {
|
if (repository != null) {
|
||||||
Spacer(modifier = StdVertSpacer)
|
Spacer(modifier = StdVertSpacer)
|
||||||
LoadAddressableNote(repository, accountViewModel) {
|
LoadAddressableNote(repository) {
|
||||||
if (it != null) {
|
if (it != null) {
|
||||||
RenderShortRepositoryHeader(it, accountViewModel, nav)
|
RenderShortRepositoryHeader(it, accountViewModel, nav)
|
||||||
}
|
}
|
||||||
@@ -550,7 +550,7 @@ private fun RenderGitIssueEvent(
|
|||||||
val repository = remember(noteEvent) { noteEvent.repositoryAddress() }
|
val repository = remember(noteEvent) { noteEvent.repositoryAddress() }
|
||||||
if (repository != null) {
|
if (repository != null) {
|
||||||
Spacer(modifier = StdVertSpacer)
|
Spacer(modifier = StdVertSpacer)
|
||||||
LoadAddressableNote(repository, accountViewModel) {
|
LoadAddressableNote(repository) {
|
||||||
if (it != null) {
|
if (it != null) {
|
||||||
RenderShortRepositoryHeader(it, accountViewModel, nav)
|
RenderShortRepositoryHeader(it, accountViewModel, nav)
|
||||||
}
|
}
|
||||||
@@ -610,7 +610,7 @@ private fun RenderGitPullRequestEvent(
|
|||||||
GitCardContainer {
|
GitCardContainer {
|
||||||
val repository = remember(noteEvent) { noteEvent.repositoryAddress() }
|
val repository = remember(noteEvent) { noteEvent.repositoryAddress() }
|
||||||
if (repository != null) {
|
if (repository != null) {
|
||||||
LoadAddressableNote(repository, accountViewModel) {
|
LoadAddressableNote(repository) {
|
||||||
if (it != null) {
|
if (it != null) {
|
||||||
RenderShortRepositoryHeader(it, accountViewModel, nav)
|
RenderShortRepositoryHeader(it, accountViewModel, nav)
|
||||||
}
|
}
|
||||||
@@ -751,7 +751,7 @@ private fun RenderGitPullRequestUpdateEvent(
|
|||||||
val repository = remember(noteEvent) { noteEvent.repositoryAddress() }
|
val repository = remember(noteEvent) { noteEvent.repositoryAddress() }
|
||||||
if (repository != null) {
|
if (repository != null) {
|
||||||
Spacer(modifier = StdVertSpacer)
|
Spacer(modifier = StdVertSpacer)
|
||||||
LoadAddressableNote(repository, accountViewModel) {
|
LoadAddressableNote(repository) {
|
||||||
if (it != null) {
|
if (it != null) {
|
||||||
RenderShortRepositoryHeader(it, accountViewModel, nav)
|
RenderShortRepositoryHeader(it, accountViewModel, nav)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ fun RenderInteractiveStory(
|
|||||||
val currentScene = readingState?.currentScene()
|
val currentScene = readingState?.currentScene()
|
||||||
|
|
||||||
if (currentScene != null && currentScene != rootEvent.address()) {
|
if (currentScene != null && currentScene != rootEvent.address()) {
|
||||||
LoadAddressableNote(currentScene, accountViewModel) { currentSceneBaseNote ->
|
LoadAddressableNote(currentScene) { currentSceneBaseNote ->
|
||||||
currentSceneBaseNote?.let {
|
currentSceneBaseNote?.let {
|
||||||
val currentSceneEvent by observeNoteEvent<InteractiveStoryBaseEvent>(it, accountViewModel)
|
val currentSceneEvent by observeNoteEvent<InteractiveStoryBaseEvent>(it, accountViewModel)
|
||||||
|
|
||||||
@@ -168,7 +168,7 @@ fun RenderInteractiveStory(
|
|||||||
if (options.isNotEmpty()) {
|
if (options.isNotEmpty()) {
|
||||||
Column(Modifier.padding(top = 10.dp)) {
|
Column(Modifier.padding(top = 10.dp)) {
|
||||||
options.forEach { opt ->
|
options.forEach { opt ->
|
||||||
LoadAddressableNote(opt.address, accountViewModel) { note ->
|
LoadAddressableNote(opt.address) { note ->
|
||||||
if (note != null) {
|
if (note != null) {
|
||||||
EventFinderFilterAssemblerSubscription(note, accountViewModel)
|
EventFinderFilterAssemblerSubscription(note, accountViewModel)
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -61,7 +61,7 @@ fun RenderLiveActivityChatMessage(
|
|||||||
}
|
}
|
||||||
|
|
||||||
showChannelInfo?.let {
|
showChannelInfo?.let {
|
||||||
LoadLiveActivityChannel(it, accountViewModel) {
|
LoadLiveActivityChannel(it) {
|
||||||
LiveActivitiesChannelHeader(
|
LiveActivitiesChannelHeader(
|
||||||
baseChannel = it,
|
baseChannel = it,
|
||||||
showVideo = false,
|
showVideo = false,
|
||||||
|
|||||||
@@ -340,7 +340,6 @@ private fun ParentMeetingSpaceLink(
|
|||||||
|
|
||||||
com.vitorpamplona.amethyst.ui.note.LoadAddressableNote(
|
com.vitorpamplona.amethyst.ui.note.LoadAddressableNote(
|
||||||
address = spaceAddress,
|
address = spaceAddress,
|
||||||
accountViewModel = accountViewModel,
|
|
||||||
) { spaceNote ->
|
) { spaceNote ->
|
||||||
spaceNote ?: return@LoadAddressableNote
|
spaceNote ?: return@LoadAddressableNote
|
||||||
val spaceEvent = spaceNote.event as? MeetingSpaceEvent
|
val spaceEvent = spaceNote.event as? MeetingSpaceEvent
|
||||||
|
|||||||
@@ -260,7 +260,7 @@ fun MusicPlaylistHeader(
|
|||||||
color = MaterialTheme.colorScheme.onSurface.copy(alpha = 0.06f),
|
color = MaterialTheme.colorScheme.onSurface.copy(alpha = 0.06f),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
LoadAddressableNote(address, accountViewModel) { trackNote ->
|
LoadAddressableNote(address) { trackNote ->
|
||||||
if (trackNote != null) {
|
if (trackNote != null) {
|
||||||
PlaylistTrackRow(
|
PlaylistTrackRow(
|
||||||
position = index + 1,
|
position = index + 1,
|
||||||
@@ -678,7 +678,7 @@ private fun RenderMusicPlaylistPreview() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ThemeComparisonColumn {
|
ThemeComparisonColumn {
|
||||||
LoadNote(baseNoteHex = event.address().toValue(), accountViewModel = mockAccountViewModel()) { note ->
|
LoadNote(baseNoteHex = event.address().toValue()) { note ->
|
||||||
note?.let {
|
note?.let {
|
||||||
RenderMusicPlaylist(
|
RenderMusicPlaylist(
|
||||||
note = it,
|
note = it,
|
||||||
@@ -710,7 +710,7 @@ private fun RenderMusicPlaylistCollaborativePrivatePreview() {
|
|||||||
remember(event) { runBlocking { withContext(Dispatchers.IO) { LocalCache.justConsume(event, null, true) } } }
|
remember(event) { runBlocking { withContext(Dispatchers.IO) { LocalCache.justConsume(event, null, true) } } }
|
||||||
|
|
||||||
ThemeComparisonColumn {
|
ThemeComparisonColumn {
|
||||||
LoadNote(baseNoteHex = event.address().toValue(), accountViewModel = mockAccountViewModel()) { note ->
|
LoadNote(baseNoteHex = event.address().toValue()) { note ->
|
||||||
note?.let {
|
note?.let {
|
||||||
RenderMusicPlaylist(
|
RenderMusicPlaylist(
|
||||||
note = it,
|
note = it,
|
||||||
@@ -740,7 +740,7 @@ private fun MusicPlaylistCoverPreview() {
|
|||||||
remember(event) { runBlocking { withContext(Dispatchers.IO) { LocalCache.justConsume(event, null, true) } } }
|
remember(event) { runBlocking { withContext(Dispatchers.IO) { LocalCache.justConsume(event, null, true) } } }
|
||||||
|
|
||||||
ThemeComparisonColumn {
|
ThemeComparisonColumn {
|
||||||
LoadNote(baseNoteHex = event.address().toValue(), accountViewModel = mockAccountViewModel()) { note ->
|
LoadNote(baseNoteHex = event.address().toValue()) { note ->
|
||||||
note?.let {
|
note?.let {
|
||||||
MusicPlaylistCover(
|
MusicPlaylistCover(
|
||||||
image = null,
|
image = null,
|
||||||
|
|||||||
@@ -517,7 +517,7 @@ private fun RenderMusicTrackPreview() {
|
|||||||
remember(event) { runBlocking { withContext(Dispatchers.IO) { LocalCache.justConsume(event, null, true) } } }
|
remember(event) { runBlocking { withContext(Dispatchers.IO) { LocalCache.justConsume(event, null, true) } } }
|
||||||
|
|
||||||
ThemeComparisonColumn {
|
ThemeComparisonColumn {
|
||||||
LoadNote(baseNoteHex = event.address().toValue(), accountViewModel = mockAccountViewModel()) { note ->
|
LoadNote(baseNoteHex = event.address().toValue()) { note ->
|
||||||
note?.let {
|
note?.let {
|
||||||
RenderMusicTrack(
|
RenderMusicTrack(
|
||||||
note = it,
|
note = it,
|
||||||
@@ -549,7 +549,7 @@ private fun RenderMusicTrackExplicitPreview() {
|
|||||||
remember(event) { runBlocking { withContext(Dispatchers.IO) { LocalCache.justConsume(event, null, true) } } }
|
remember(event) { runBlocking { withContext(Dispatchers.IO) { LocalCache.justConsume(event, null, true) } } }
|
||||||
|
|
||||||
ThemeComparisonColumn {
|
ThemeComparisonColumn {
|
||||||
LoadNote(baseNoteHex = event.address().toValue(), accountViewModel = mockAccountViewModel()) { note ->
|
LoadNote(baseNoteHex = event.address().toValue()) { note ->
|
||||||
note?.let {
|
note?.let {
|
||||||
RenderMusicTrack(
|
RenderMusicTrack(
|
||||||
note = it,
|
note = it,
|
||||||
@@ -571,7 +571,7 @@ private fun MusicTrackCoverPreview() {
|
|||||||
remember(event) { runBlocking { withContext(Dispatchers.IO) { LocalCache.justConsume(event, null, true) } } }
|
remember(event) { runBlocking { withContext(Dispatchers.IO) { LocalCache.justConsume(event, null, true) } } }
|
||||||
|
|
||||||
ThemeComparisonColumn {
|
ThemeComparisonColumn {
|
||||||
LoadNote(baseNoteHex = event.address().toValue(), accountViewModel = mockAccountViewModel()) { note ->
|
LoadNote(baseNoteHex = event.address().toValue()) { note ->
|
||||||
note?.let { MusicTrackCover(image = null, note = it, accountViewModel = mockAccountViewModel()) }
|
note?.let { MusicTrackCover(image = null, note = it, accountViewModel = mockAccountViewModel()) }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ import com.vitorpamplona.amethyst.commons.resources.Res
|
|||||||
import com.vitorpamplona.amethyst.commons.resources.podcast_hosts_and_guests
|
import com.vitorpamplona.amethyst.commons.resources.podcast_hosts_and_guests
|
||||||
import com.vitorpamplona.amethyst.commons.ui.components.RobohashFallbackAsyncImage
|
import com.vitorpamplona.amethyst.commons.ui.components.RobohashFallbackAsyncImage
|
||||||
import com.vitorpamplona.amethyst.commons.ui.navigation.navs.INav
|
import com.vitorpamplona.amethyst.commons.ui.navigation.navs.INav
|
||||||
|
import com.vitorpamplona.amethyst.commons.ui.screen.LocalDisplaySettings
|
||||||
import com.vitorpamplona.amethyst.commons.ui.stringRes
|
import com.vitorpamplona.amethyst.commons.ui.stringRes
|
||||||
import com.vitorpamplona.amethyst.commons.ui.theme.Size5dp
|
import com.vitorpamplona.amethyst.commons.ui.theme.Size5dp
|
||||||
import com.vitorpamplona.amethyst.commons.ui.theme.grayText
|
import com.vitorpamplona.amethyst.commons.ui.theme.grayText
|
||||||
@@ -104,7 +105,7 @@ private fun PersonItem(
|
|||||||
val pubKey = remember(person) { person.nostrPubKey() }
|
val pubKey = remember(person) { person.nostrPubKey() }
|
||||||
|
|
||||||
if (pubKey != null) {
|
if (pubKey != null) {
|
||||||
LoadUser(pubKey, accountViewModel) { user ->
|
LoadUser(pubKey) { user ->
|
||||||
if (user != null) {
|
if (user != null) {
|
||||||
NostrPersonCard(user, person.role, accountViewModel, nav)
|
NostrPersonCard(user, person.role, accountViewModel, nav)
|
||||||
} else {
|
} else {
|
||||||
@@ -157,8 +158,8 @@ private fun FreeTextPersonCard(
|
|||||||
model = person.img,
|
model = person.img,
|
||||||
contentDescription = person.name,
|
contentDescription = person.name,
|
||||||
modifier = Modifier.size(56.dp).clip(CircleShape),
|
modifier = Modifier.size(56.dp).clip(CircleShape),
|
||||||
loadProfilePicture = accountViewModel.settings.showProfilePictures(),
|
loadProfilePicture = LocalDisplaySettings.current.showProfilePictures,
|
||||||
loadRobohash = accountViewModel.settings.isNotPerformanceMode(),
|
loadRobohash = LocalDisplaySettings.current.loadRobohash,
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
name = {
|
name = {
|
||||||
|
|||||||
@@ -319,7 +319,7 @@ internal fun PublicationSectionRow(
|
|||||||
val address = ref.address
|
val address = ref.address
|
||||||
|
|
||||||
if (address != null) {
|
if (address != null) {
|
||||||
LoadAddressableNote(address, accountViewModel) { sectionNote ->
|
LoadAddressableNote(address) { sectionNote ->
|
||||||
if (sectionNote != null) {
|
if (sectionNote != null) {
|
||||||
ObservedSectionRow(position, ref, sectionNote, accountViewModel, nav)
|
ObservedSectionRow(position, ref, sectionNote, accountViewModel, nav)
|
||||||
} else {
|
} else {
|
||||||
@@ -327,7 +327,7 @@ internal fun PublicationSectionRow(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (ref.eventId != null) {
|
} else if (ref.eventId != null) {
|
||||||
LoadNote(ref.eventId!!, accountViewModel) { sectionNote ->
|
LoadNote(ref.eventId!!) { sectionNote ->
|
||||||
if (sectionNote != null) {
|
if (sectionNote != null) {
|
||||||
ObservedSectionRow(position, ref, sectionNote, accountViewModel, nav)
|
ObservedSectionRow(position, ref, sectionNote, accountViewModel, nav)
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
+4
-4
@@ -113,7 +113,7 @@ fun RenderPublicationSection(
|
|||||||
// A chapter arrived at from a search, a mention or a wikilink has nothing around it to say
|
// A chapter arrived at from a search, a mention or a wikilink has nothing around it to say
|
||||||
// what it is a chapter *of*. The index names itself, so show it above the title.
|
// what it is a chapter *of*. The index names itself, so show it above the title.
|
||||||
noteEvent.publicationAddress()?.let { address ->
|
noteEvent.publicationAddress()?.let { address ->
|
||||||
LoadAddressableNote(address, accountViewModel) { indexNote ->
|
LoadAddressableNote(address) { indexNote ->
|
||||||
indexNote?.let { PublicationCrumb(it, accountViewModel, nav) }
|
indexNote?.let { PublicationCrumb(it, accountViewModel, nav) }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -142,7 +142,7 @@ fun RenderPublicationSection(
|
|||||||
}
|
}
|
||||||
|
|
||||||
noteEvent.publicationAddress()?.let { address ->
|
noteEvent.publicationAddress()?.let { address ->
|
||||||
LoadAddressableNote(address, accountViewModel) { indexNote ->
|
LoadAddressableNote(address) { indexNote ->
|
||||||
indexNote?.let { PublicationPager(noteEvent, it, accountViewModel, nav) }
|
indexNote?.let { PublicationPager(noteEvent, it, accountViewModel, nav) }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -253,11 +253,11 @@ private fun PagerEnd(
|
|||||||
// The index's own title shows immediately; the neighbour is still observed, because observing
|
// The index's own title shows immediately; the neighbour is still observed, because observing
|
||||||
// is what fetches it and it carries the better title.
|
// is what fetches it and it carries the better title.
|
||||||
if (address != null) {
|
if (address != null) {
|
||||||
LoadAddressableNote(address, accountViewModel) { target ->
|
LoadAddressableNote(address) { target ->
|
||||||
target?.let { PagerButton(ref, it, isBack, accountViewModel, nav, modifier) }
|
target?.let { PagerButton(ref, it, isBack, accountViewModel, nav, modifier) }
|
||||||
}
|
}
|
||||||
} else if (eventId != null) {
|
} else if (eventId != null) {
|
||||||
LoadNote(eventId, accountViewModel) { target ->
|
LoadNote(eventId) { target ->
|
||||||
target?.let { PagerButton(ref, it, isBack, accountViewModel, nav, modifier) }
|
target?.let { PagerButton(ref, it, isBack, accountViewModel, nav, modifier) }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-2
@@ -51,6 +51,7 @@ import com.vitorpamplona.amethyst.commons.nip29RelayGroups.ui.RelayNameChip
|
|||||||
import com.vitorpamplona.amethyst.commons.ui.components.GenericLoadable
|
import com.vitorpamplona.amethyst.commons.ui.components.GenericLoadable
|
||||||
import com.vitorpamplona.amethyst.commons.ui.components.RobohashFallbackAsyncImage
|
import com.vitorpamplona.amethyst.commons.ui.components.RobohashFallbackAsyncImage
|
||||||
import com.vitorpamplona.amethyst.commons.ui.navigation.navs.INav
|
import com.vitorpamplona.amethyst.commons.ui.navigation.navs.INav
|
||||||
|
import com.vitorpamplona.amethyst.commons.ui.screen.LocalDisplaySettings
|
||||||
import com.vitorpamplona.amethyst.commons.ui.theme.StdVertSpacer
|
import com.vitorpamplona.amethyst.commons.ui.theme.StdVertSpacer
|
||||||
import com.vitorpamplona.amethyst.commons.ui.theme.replyModifier
|
import com.vitorpamplona.amethyst.commons.ui.theme.replyModifier
|
||||||
import com.vitorpamplona.amethyst.service.relayClient.reqCommand.user.observeUserName
|
import com.vitorpamplona.amethyst.service.relayClient.reqCommand.user.observeUserName
|
||||||
@@ -135,8 +136,8 @@ fun RelayGroupChannelHeader(
|
|||||||
model = channel.profilePicture(),
|
model = channel.profilePicture(),
|
||||||
contentDescription = channel.toBestDisplayName(),
|
contentDescription = channel.toBestDisplayName(),
|
||||||
modifier = Modifier.size(28.dp).clip(CircleShape),
|
modifier = Modifier.size(28.dp).clip(CircleShape),
|
||||||
loadProfilePicture = accountViewModel.settings.showProfilePictures(),
|
loadProfilePicture = LocalDisplaySettings.current.showProfilePictures,
|
||||||
loadRobohash = accountViewModel.settings.isNotPerformanceMode(),
|
loadRobohash = LocalDisplaySettings.current.loadRobohash,
|
||||||
)
|
)
|
||||||
|
|
||||||
if (dmOther != null) {
|
if (dmOther != null) {
|
||||||
|
|||||||
+1
-1
@@ -58,7 +58,7 @@ fun RenderPostApproval(
|
|||||||
|
|
||||||
Column(Modifier.fillMaxWidth()) {
|
Column(Modifier.fillMaxWidth()) {
|
||||||
noteEvent.communityAddresses().forEach { tag ->
|
noteEvent.communityAddresses().forEach { tag ->
|
||||||
LoadAddressableNote(tag, accountViewModel) { baseNote ->
|
LoadAddressableNote(tag) { baseNote ->
|
||||||
baseNote?.let {
|
baseNote?.let {
|
||||||
RenderCommunity(
|
RenderCommunity(
|
||||||
baseNote = it,
|
baseNote = it,
|
||||||
|
|||||||
+1
-1
@@ -82,7 +82,7 @@ fun RenderVideoCollaboration(
|
|||||||
// quotesLeft guards the recursion: the embedded video can itself credit other work, and
|
// quotesLeft guards the recursion: the embedded video can itself credit other work, and
|
||||||
// NoteCompose is what decrements it on the way down.
|
// NoteCompose is what decrements it on the way down.
|
||||||
if (video != null && quotesLeft > 0) {
|
if (video != null && quotesLeft > 0) {
|
||||||
LoadAddressableNote(video, accountViewModel) { videoNote ->
|
LoadAddressableNote(video) { videoNote ->
|
||||||
videoNote?.let {
|
videoNote?.let {
|
||||||
NoteCompose(
|
NoteCompose(
|
||||||
baseNote = it,
|
baseNote = it,
|
||||||
|
|||||||
+1
-1
@@ -103,7 +103,7 @@ private fun RenderVideoCredit(
|
|||||||
) {
|
) {
|
||||||
when (val target = credit.target) {
|
when (val target = credit.target) {
|
||||||
is CreditTarget.Person ->
|
is CreditTarget.Person ->
|
||||||
LoadUser(target.pubKey, accountViewModel) { user ->
|
LoadUser(target.pubKey) { user ->
|
||||||
// Until the profile arrives there is no name to print, and a hex key in the
|
// Until the profile arrives there is no name to print, and a hex key in the
|
||||||
// credits reads as noise rather than as a person.
|
// credits reads as noise rather than as a person.
|
||||||
user?.let {
|
user?.let {
|
||||||
|
|||||||
+2
-2
@@ -169,12 +169,12 @@ private fun VideoListMemberPoster(
|
|||||||
) {
|
) {
|
||||||
when (item) {
|
when (item) {
|
||||||
is AddressBookmark ->
|
is AddressBookmark ->
|
||||||
LoadAddressableNote(item.address, accountViewModel) { note ->
|
LoadAddressableNote(item.address) { note ->
|
||||||
note?.let { VideoPoster(it, accountViewModel) { nav.nav(Route.Note(addressTag(item.address))) } }
|
note?.let { VideoPoster(it, accountViewModel) { nav.nav(Route.Note(addressTag(item.address))) } }
|
||||||
}
|
}
|
||||||
|
|
||||||
is EventBookmark ->
|
is EventBookmark ->
|
||||||
LoadNote(item.eventId, accountViewModel) { note ->
|
LoadNote(item.eventId) { note ->
|
||||||
note?.let { VideoPoster(it, accountViewModel) { nav.nav(Route.Note(item.eventId)) } }
|
note?.let { VideoPoster(it, accountViewModel) { nav.nav(Route.Note(item.eventId)) } }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ fun WithSnoPalette(
|
|||||||
is NEvent -> LoadPaletteNote(entity.hex, accountViewModel, content)
|
is NEvent -> LoadPaletteNote(entity.hex, accountViewModel, content)
|
||||||
is NNote -> LoadPaletteNote(entity.hex, accountViewModel, content)
|
is NNote -> LoadPaletteNote(entity.hex, accountViewModel, content)
|
||||||
is NAddress ->
|
is NAddress ->
|
||||||
LoadAddressableNote(entity.address(), accountViewModel) { note ->
|
LoadAddressableNote(entity.address()) { note ->
|
||||||
content(remember(note?.event) { note?.event?.let { SnoPaletteEventReader.read(it) } })
|
content(remember(note?.event) { note?.event?.let { SnoPaletteEventReader.read(it) } })
|
||||||
}
|
}
|
||||||
// A reference the parser accepted as well-formed but that names nothing
|
// A reference the parser accepted as well-formed but that names nothing
|
||||||
@@ -91,7 +91,7 @@ private fun LoadPaletteNote(
|
|||||||
accountViewModel: AccountViewModel,
|
accountViewModel: AccountViewModel,
|
||||||
content: @Composable (SnoPalette?) -> Unit,
|
content: @Composable (SnoPalette?) -> Unit,
|
||||||
) {
|
) {
|
||||||
LoadNote(hex, accountViewModel) { note ->
|
LoadNote(hex) { note ->
|
||||||
// The kind is deliberately not checked: §1.3b says this format "does
|
// The kind is deliberately not checked: §1.3b says this format "does
|
||||||
// not define a palette kind and does not want one", and a reader that
|
// not define a palette kind and does not want one", and a reader that
|
||||||
// accepts the shape reads whatever convention wins. An event that is
|
// accepts the shape reads whatever convention wins. An event that is
|
||||||
|
|||||||
@@ -587,7 +587,7 @@ private fun BundledAssetsList(
|
|||||||
Column(verticalArrangement = Arrangement.spacedBy(4.dp)) {
|
Column(verticalArrangement = Arrangement.spacedBy(4.dp)) {
|
||||||
assetIds.forEach { id ->
|
assetIds.forEach { id ->
|
||||||
key(id) {
|
key(id) {
|
||||||
LoadAssetNote(id, accountViewModel) { assetNote ->
|
LoadAssetNote(id) { assetNote ->
|
||||||
if (assetNote != null) {
|
if (assetNote != null) {
|
||||||
SoftwareAssetRow(assetNote, accountViewModel)
|
SoftwareAssetRow(assetNote, accountViewModel)
|
||||||
}
|
}
|
||||||
@@ -600,7 +600,6 @@ private fun BundledAssetsList(
|
|||||||
@Composable
|
@Composable
|
||||||
private fun LoadAssetNote(
|
private fun LoadAssetNote(
|
||||||
eventId: String,
|
eventId: String,
|
||||||
accountViewModel: AccountViewModel,
|
|
||||||
content: @Composable (Note?) -> Unit,
|
content: @Composable (Note?) -> Unit,
|
||||||
) {
|
) {
|
||||||
val note by produceState<Note?>(initialValue = LocalCache.getNoteIfExists(eventId), eventId) {
|
val note by produceState<Note?>(initialValue = LocalCache.getNoteIfExists(eventId), eventId) {
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ fun RenderTextModificationEvent(
|
|||||||
}
|
}
|
||||||
|
|
||||||
noteEvent.editedNote()?.let {
|
noteEvent.editedNote()?.let {
|
||||||
LoadNote(baseNoteHex = it.eventId, accountViewModel = accountViewModel) { baseOriginalNote ->
|
LoadNote(baseNoteHex = it.eventId) { baseOriginalNote ->
|
||||||
baseOriginalNote?.let {
|
baseOriginalNote?.let {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -133,7 +133,7 @@ fun RenderTextModificationEvent(
|
|||||||
}
|
}
|
||||||
|
|
||||||
noteEvent.editedNote()?.let {
|
noteEvent.editedNote()?.let {
|
||||||
LoadNote(baseNoteHex = it.eventId, accountViewModel = accountViewModel) { baseNote ->
|
LoadNote(baseNoteHex = it.eventId) { baseNote ->
|
||||||
baseNote?.let {
|
baseNote?.let {
|
||||||
val noteState by observeNote(baseNote, accountViewModel)
|
val noteState by observeNote(baseNote, accountViewModel)
|
||||||
|
|
||||||
|
|||||||
@@ -212,7 +212,7 @@ fun TorrentHeader(
|
|||||||
accountViewModel: AccountViewModel,
|
accountViewModel: AccountViewModel,
|
||||||
nav: INav,
|
nav: INav,
|
||||||
) {
|
) {
|
||||||
LoadNote(baseNoteHex = torrentHex, accountViewModel = accountViewModel) {
|
LoadNote(baseNoteHex = torrentHex) {
|
||||||
if (it != null) {
|
if (it != null) {
|
||||||
ShortTorrentHeader(it, modifier, accountViewModel, nav)
|
ShortTorrentHeader(it, modifier, accountViewModel, nav)
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -213,7 +213,7 @@ private fun WikiArticleRow(
|
|||||||
accountViewModel: AccountViewModel,
|
accountViewModel: AccountViewModel,
|
||||||
nav: INav,
|
nav: INav,
|
||||||
) {
|
) {
|
||||||
LoadAddressableNote(address, accountViewModel) { articleNote ->
|
LoadAddressableNote(address) { articleNote ->
|
||||||
if (articleNote != null) {
|
if (articleNote != null) {
|
||||||
val article by observeNoteEvent<WikiNoteEvent>(articleNote, accountViewModel)
|
val article by observeNoteEvent<WikiNoteEvent>(articleNote, accountViewModel)
|
||||||
|
|
||||||
@@ -238,7 +238,7 @@ private fun WikiVersionRow(
|
|||||||
accountViewModel: AccountViewModel,
|
accountViewModel: AccountViewModel,
|
||||||
nav: INav,
|
nav: INav,
|
||||||
) {
|
) {
|
||||||
LoadNote(eventId, accountViewModel) { versionNote ->
|
LoadNote(eventId) { versionNote ->
|
||||||
if (versionNote != null) {
|
if (versionNote != null) {
|
||||||
val article by observeNoteEvent<WikiNoteEvent>(versionNote, accountViewModel)
|
val article by observeNoteEvent<WikiNoteEvent>(versionNote, accountViewModel)
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -58,7 +58,7 @@ fun UserMemberRow(
|
|||||||
accountViewModel: AccountViewModel,
|
accountViewModel: AccountViewModel,
|
||||||
nav: INav,
|
nav: INav,
|
||||||
) {
|
) {
|
||||||
LoadUser(pubKey, accountViewModel) { user ->
|
LoadUser(pubKey) { user ->
|
||||||
user?.let {
|
user?.let {
|
||||||
Column(modifier = Modifier.fillMaxWidth()) {
|
Column(modifier = Modifier.fillMaxWidth()) {
|
||||||
UserCompose(it, accountViewModel = accountViewModel, nav = nav)
|
UserCompose(it, accountViewModel = accountViewModel, nav = nav)
|
||||||
@@ -88,7 +88,7 @@ fun BookmarkMemberRow(
|
|||||||
is AddressBookmark -> AddressMemberRow(item.address, quotesLeft, backgroundColor, accountViewModel, nav)
|
is AddressBookmark -> AddressMemberRow(item.address, quotesLeft, backgroundColor, accountViewModel, nav)
|
||||||
|
|
||||||
is EventBookmark ->
|
is EventBookmark ->
|
||||||
LoadNote(item.eventId, accountViewModel) { note ->
|
LoadNote(item.eventId) { note ->
|
||||||
note?.let {
|
note?.let {
|
||||||
NoteCompose(
|
NoteCompose(
|
||||||
baseNote = it,
|
baseNote = it,
|
||||||
@@ -114,7 +114,7 @@ fun AddressMemberRow(
|
|||||||
) {
|
) {
|
||||||
if (quotesLeft <= 0) return
|
if (quotesLeft <= 0) return
|
||||||
|
|
||||||
LoadAddressableNote(address, accountViewModel) { note ->
|
LoadAddressableNote(address) { note ->
|
||||||
note?.let {
|
note?.let {
|
||||||
NoteCompose(
|
NoteCompose(
|
||||||
baseNote = it,
|
baseNote = it,
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ private fun MutedThreadRow(
|
|||||||
) {
|
) {
|
||||||
if (quotesLeft <= 0) return
|
if (quotesLeft <= 0) return
|
||||||
|
|
||||||
LoadNote(eventId, accountViewModel) { note ->
|
LoadNote(eventId) { note ->
|
||||||
note?.let {
|
note?.let {
|
||||||
NoteCompose(
|
NoteCompose(
|
||||||
baseNote = it,
|
baseNote = it,
|
||||||
|
|||||||
+1
-1
@@ -100,12 +100,12 @@ import com.vitorpamplona.amethyst.commons.service.broadcast.BroadcastTracker
|
|||||||
import com.vitorpamplona.amethyst.commons.service.http.EmptyRoleBasedHttpClientBuilder
|
import com.vitorpamplona.amethyst.commons.service.http.EmptyRoleBasedHttpClientBuilder
|
||||||
import com.vitorpamplona.amethyst.commons.service.http.IRoleBasedHttpClientBuilder
|
import com.vitorpamplona.amethyst.commons.service.http.IRoleBasedHttpClientBuilder
|
||||||
import com.vitorpamplona.amethyst.commons.service.pow.PoWCategory
|
import com.vitorpamplona.amethyst.commons.service.pow.PoWCategory
|
||||||
|
import com.vitorpamplona.amethyst.commons.state.UiSettingsState
|
||||||
import com.vitorpamplona.amethyst.commons.tor.TorType
|
import com.vitorpamplona.amethyst.commons.tor.TorType
|
||||||
import com.vitorpamplona.amethyst.commons.ui.components.UrlPreviewState
|
import com.vitorpamplona.amethyst.commons.ui.components.UrlPreviewState
|
||||||
import com.vitorpamplona.amethyst.commons.ui.components.toasts.ToastManager
|
import com.vitorpamplona.amethyst.commons.ui.components.toasts.ToastManager
|
||||||
import com.vitorpamplona.amethyst.commons.ui.loadStringRes
|
import com.vitorpamplona.amethyst.commons.ui.loadStringRes
|
||||||
import com.vitorpamplona.amethyst.commons.ui.notifications.CardFeedState
|
import com.vitorpamplona.amethyst.commons.ui.notifications.CardFeedState
|
||||||
import com.vitorpamplona.amethyst.commons.ui.screen.UiSettingsState
|
|
||||||
import com.vitorpamplona.amethyst.commons.ui.state.GenericBaseCache
|
import com.vitorpamplona.amethyst.commons.ui.state.GenericBaseCache
|
||||||
import com.vitorpamplona.amethyst.commons.ui.state.GenericBaseCacheAsync
|
import com.vitorpamplona.amethyst.commons.ui.state.GenericBaseCacheAsync
|
||||||
import com.vitorpamplona.amethyst.logTime
|
import com.vitorpamplona.amethyst.logTime
|
||||||
|
|||||||
+10
-9
@@ -72,6 +72,7 @@ import com.vitorpamplona.amethyst.commons.model.navigation.routeFor
|
|||||||
import com.vitorpamplona.amethyst.commons.model.nip29RelayGroups.RelayGroupChannel
|
import com.vitorpamplona.amethyst.commons.model.nip29RelayGroups.RelayGroupChannel
|
||||||
import com.vitorpamplona.amethyst.commons.ui.components.RobohashFallbackAsyncImage
|
import com.vitorpamplona.amethyst.commons.ui.components.RobohashFallbackAsyncImage
|
||||||
import com.vitorpamplona.amethyst.commons.ui.navigation.navs.INav
|
import com.vitorpamplona.amethyst.commons.ui.navigation.navs.INav
|
||||||
|
import com.vitorpamplona.amethyst.commons.ui.screen.LocalDisplaySettings
|
||||||
import com.vitorpamplona.amethyst.commons.ui.theme.placeholderText
|
import com.vitorpamplona.amethyst.commons.ui.theme.placeholderText
|
||||||
import com.vitorpamplona.amethyst.commons.util.toShortDisplay
|
import com.vitorpamplona.amethyst.commons.util.toShortDisplay
|
||||||
import com.vitorpamplona.amethyst.service.relayClient.reqCommand.channel.observeChannel
|
import com.vitorpamplona.amethyst.service.relayClient.reqCommand.channel.observeChannel
|
||||||
@@ -269,7 +270,7 @@ private fun PersonCell(
|
|||||||
Badge.ADDED -> "+" to tones.added
|
Badge.ADDED -> "+" to tones.added
|
||||||
Badge.CHANGED -> "~" to tones.changed
|
Badge.CHANGED -> "~" to tones.changed
|
||||||
}
|
}
|
||||||
LoadUser(pubKey, accountViewModel) { user ->
|
LoadUser(pubKey) { user ->
|
||||||
Column(
|
Column(
|
||||||
modifier.clip(RoundedCornerShape(12.dp)).clickable { nav.nav(Route.Profile(pubKey)) }.padding(vertical = 4.dp),
|
modifier.clip(RoundedCornerShape(12.dp)).clickable { nav.nav(Route.Profile(pubKey)) }.padding(vertical = 4.dp),
|
||||||
horizontalAlignment = Alignment.CenterHorizontally,
|
horizontalAlignment = Alignment.CenterHorizontally,
|
||||||
@@ -437,7 +438,7 @@ private fun LazyListScope.muteListItems(
|
|||||||
if (threads.isNotEmpty()) {
|
if (threads.isNotEmpty()) {
|
||||||
item(key = "mute-threads-caption", contentType = "caption") { SectionCaption(stringRes(R.string.backup_entry_thread), Pad.padding(top = 18.dp)) }
|
item(key = "mute-threads-caption", contentType = "caption") { SectionCaption(stringRes(R.string.backup_entry_thread), Pad.padding(top = 18.dp)) }
|
||||||
items(threads, key = { "mute-thread-$it" }, contentType = { "note" }) { id ->
|
items(threads, key = { "mute-thread-$it" }, contentType = { "note" }) { id ->
|
||||||
LoadNote(id, accountViewModel) { note ->
|
LoadNote(id) { note ->
|
||||||
if (note != null) {
|
if (note != null) {
|
||||||
NoteCompose(note, modifier = Modifier.padding(horizontal = 16.dp, vertical = 6.dp), makeItShort = true, quotesLeft = 1, accountViewModel = accountViewModel, nav = nav)
|
NoteCompose(note, modifier = Modifier.padding(horizontal = 16.dp, vertical = 6.dp), makeItShort = true, quotesLeft = 1, accountViewModel = accountViewModel, nav = nav)
|
||||||
} else {
|
} else {
|
||||||
@@ -489,8 +490,8 @@ private fun FacePile(
|
|||||||
model = observedPicture(pubKey, accountViewModel),
|
model = observedPicture(pubKey, accountViewModel),
|
||||||
contentDescription = null,
|
contentDescription = null,
|
||||||
modifier = Modifier.size(42.dp).clip(CircleShape),
|
modifier = Modifier.size(42.dp).clip(CircleShape),
|
||||||
loadProfilePicture = accountViewModel.settings.showProfilePictures(),
|
loadProfilePicture = LocalDisplaySettings.current.showProfilePictures,
|
||||||
loadRobohash = accountViewModel.settings.isNotPerformanceMode(),
|
loadRobohash = LocalDisplaySettings.current.loadRobohash,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -688,8 +689,8 @@ private fun MiniProfileCard(
|
|||||||
model = meta.picture,
|
model = meta.picture,
|
||||||
contentDescription = null,
|
contentDescription = null,
|
||||||
modifier = Modifier.size(46.dp).clip(CircleShape),
|
modifier = Modifier.size(46.dp).clip(CircleShape),
|
||||||
loadProfilePicture = accountViewModel.settings.showProfilePictures(),
|
loadProfilePicture = LocalDisplaySettings.current.showProfilePictures,
|
||||||
loadRobohash = accountViewModel.settings.isNotPerformanceMode(),
|
loadRobohash = LocalDisplaySettings.current.loadRobohash,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
Column(Modifier.offset(y = (-20).dp), verticalArrangement = Arrangement.spacedBy(3.dp)) {
|
Column(Modifier.offset(y = (-20).dp), verticalArrangement = Arrangement.spacedBy(3.dp)) {
|
||||||
@@ -1122,7 +1123,7 @@ private fun GroupTileCard(
|
|||||||
GroupTileContent(tile, tile.group.name ?: tile.group.groupId, null, accountViewModel, modifier, null)
|
GroupTileContent(tile, tile.group.name ?: tile.group.groupId, null, accountViewModel, modifier, null)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
LoadRelayGroupChannel(GroupId(tile.group.groupId, relay), accountViewModel) { channel ->
|
LoadRelayGroupChannel(GroupId(tile.group.groupId, relay)) { channel ->
|
||||||
// Subscribes to the group's relay-signed metadata (even when not joined) and recomposes
|
// Subscribes to the group's relay-signed metadata (even when not joined) and recomposes
|
||||||
// when its name or picture arrives.
|
// when its name or picture arrives.
|
||||||
val state by observeChannel(channel, accountViewModel)
|
val state by observeChannel(channel, accountViewModel)
|
||||||
@@ -1158,8 +1159,8 @@ private fun GroupTileContent(
|
|||||||
model = picture,
|
model = picture,
|
||||||
contentDescription = null,
|
contentDescription = null,
|
||||||
modifier = Modifier.size(44.dp).clip(RoundedCornerShape(14.dp)),
|
modifier = Modifier.size(44.dp).clip(RoundedCornerShape(14.dp)),
|
||||||
loadProfilePicture = accountViewModel.settings.showProfilePictures(),
|
loadProfilePicture = LocalDisplaySettings.current.showProfilePictures,
|
||||||
loadRobohash = accountViewModel.settings.isNotPerformanceMode(),
|
loadRobohash = LocalDisplaySettings.current.loadRobohash,
|
||||||
)
|
)
|
||||||
Column {
|
Column {
|
||||||
Text(name, style = MaterialTheme.typography.titleSmall, maxLines = 1, overflow = TextOverflow.Ellipsis)
|
Text(name, style = MaterialTheme.typography.titleSmall, maxLines = 1, overflow = TextOverflow.Ellipsis)
|
||||||
|
|||||||
+8
-7
@@ -65,6 +65,7 @@ import com.vitorpamplona.amethyst.commons.model.navigation.Route
|
|||||||
import com.vitorpamplona.amethyst.commons.model.navigation.routeFor
|
import com.vitorpamplona.amethyst.commons.model.navigation.routeFor
|
||||||
import com.vitorpamplona.amethyst.commons.ui.components.RobohashFallbackAsyncImage
|
import com.vitorpamplona.amethyst.commons.ui.components.RobohashFallbackAsyncImage
|
||||||
import com.vitorpamplona.amethyst.commons.ui.navigation.navs.INav
|
import com.vitorpamplona.amethyst.commons.ui.navigation.navs.INav
|
||||||
|
import com.vitorpamplona.amethyst.commons.ui.screen.LocalDisplaySettings
|
||||||
import com.vitorpamplona.amethyst.commons.ui.theme.placeholderText
|
import com.vitorpamplona.amethyst.commons.ui.theme.placeholderText
|
||||||
import com.vitorpamplona.amethyst.commons.util.toShortDisplay
|
import com.vitorpamplona.amethyst.commons.util.toShortDisplay
|
||||||
import com.vitorpamplona.amethyst.service.relayClient.reqCommand.channel.observeChannel
|
import com.vitorpamplona.amethyst.service.relayClient.reqCommand.channel.observeChannel
|
||||||
@@ -425,8 +426,8 @@ private fun SpaceTile(
|
|||||||
model = picture,
|
model = picture,
|
||||||
contentDescription = null,
|
contentDescription = null,
|
||||||
modifier = Modifier.size(48.dp).clip(CircleShape),
|
modifier = Modifier.size(48.dp).clip(CircleShape),
|
||||||
loadProfilePicture = accountViewModel.settings.showProfilePictures(),
|
loadProfilePicture = LocalDisplaySettings.current.showProfilePictures,
|
||||||
loadRobohash = accountViewModel.settings.isNotPerformanceMode(),
|
loadRobohash = LocalDisplaySettings.current.loadRobohash,
|
||||||
)
|
)
|
||||||
Column {
|
Column {
|
||||||
Text(name, style = MaterialTheme.typography.titleSmall, maxLines = 1, overflow = TextOverflow.Ellipsis)
|
Text(name, style = MaterialTheme.typography.titleSmall, maxLines = 1, overflow = TextOverflow.Ellipsis)
|
||||||
@@ -452,7 +453,7 @@ private fun LazyListScope.publicChatItems(
|
|||||||
) {
|
) {
|
||||||
val saved = (conflict.saved as? ChannelListEvent)?.tags?.channels().orEmpty()
|
val saved = (conflict.saved as? ChannelListEvent)?.tags?.channels().orEmpty()
|
||||||
spaceGrid("chat-", fates(saved, diff.channels) { it.eventId }, { it.eventId }) { tag, fate, modifier ->
|
spaceGrid("chat-", fates(saved, diff.channels) { it.eventId }, { it.eventId }) { tag, fate, modifier ->
|
||||||
LoadPublicChatChannel(tag.eventId, accountViewModel) { channel ->
|
LoadPublicChatChannel(tag.eventId) { channel ->
|
||||||
// Subscribes to the channel's metadata on relays and recomposes when it arrives.
|
// Subscribes to the channel's metadata on relays and recomposes when it arrives.
|
||||||
val state by observeChannel(channel, accountViewModel)
|
val state by observeChannel(channel, accountViewModel)
|
||||||
val current = state?.channel ?: channel
|
val current = state?.channel ?: channel
|
||||||
@@ -508,7 +509,7 @@ private fun AddressableSpaceTile(
|
|||||||
modifier: Modifier,
|
modifier: Modifier,
|
||||||
onClick: () -> Unit,
|
onClick: () -> Unit,
|
||||||
) {
|
) {
|
||||||
LoadAddressableNote(address, accountViewModel) { note ->
|
LoadAddressableNote(address) { note ->
|
||||||
val event =
|
val event =
|
||||||
if (note != null) {
|
if (note != null) {
|
||||||
val state by observeNote(note, accountViewModel)
|
val state by observeNote(note, accountViewModel)
|
||||||
@@ -789,7 +790,7 @@ private fun ProviderCell(
|
|||||||
Text("—", modifier, color = MaterialTheme.colorScheme.placeholderText)
|
Text("—", modifier, color = MaterialTheme.colorScheme.placeholderText)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
LoadUser(pubKey, accountViewModel) { user ->
|
LoadUser(pubKey) { user ->
|
||||||
Row(
|
Row(
|
||||||
modifier.clip(RoundedCornerShape(8.dp)).clickable { nav.nav(Route.Profile(pubKey)) },
|
modifier.clip(RoundedCornerShape(8.dp)).clickable { nav.nav(Route.Profile(pubKey)) },
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
@@ -801,8 +802,8 @@ private fun ProviderCell(
|
|||||||
model = observedPicture(pubKey, accountViewModel),
|
model = observedPicture(pubKey, accountViewModel),
|
||||||
contentDescription = null,
|
contentDescription = null,
|
||||||
modifier = Modifier.size(22.dp).clip(CircleShape),
|
modifier = Modifier.size(22.dp).clip(CircleShape),
|
||||||
loadProfilePicture = accountViewModel.settings.showProfilePictures(),
|
loadProfilePicture = LocalDisplaySettings.current.showProfilePictures,
|
||||||
loadRobohash = accountViewModel.settings.isNotPerformanceMode(),
|
loadRobohash = LocalDisplaySettings.current.loadRobohash,
|
||||||
)
|
)
|
||||||
ProvideTextStyle(MaterialTheme.typography.labelMedium.copy(color = if (struck) color else MaterialTheme.colorScheme.onSurface, textDecoration = if (struck) TextDecoration.LineThrough else null)) {
|
ProvideTextStyle(MaterialTheme.typography.labelMedium.copy(color = if (struck) color else MaterialTheme.colorScheme.onSurface, textDecoration = if (struck) TextDecoration.LineThrough else null)) {
|
||||||
if (user != null) {
|
if (user != null) {
|
||||||
|
|||||||
+4
-4
@@ -422,7 +422,7 @@ internal fun ReviewEntry(
|
|||||||
when (item) {
|
when (item) {
|
||||||
is ReviewItem.Person -> PersonEntry(item, accountViewModel, nav)
|
is ReviewItem.Person -> PersonEntry(item, accountViewModel, nav)
|
||||||
is ReviewItem.Thread ->
|
is ReviewItem.Thread ->
|
||||||
LoadNote(item.eventId, accountViewModel) { note ->
|
LoadNote(item.eventId) { note ->
|
||||||
if (note != null) {
|
if (note != null) {
|
||||||
Column(EntryPadding) {
|
Column(EntryPadding) {
|
||||||
NoteCompose(note, makeItShort = true, quotesLeft = 1, accountViewModel = accountViewModel, nav = nav)
|
NoteCompose(note, makeItShort = true, quotesLeft = 1, accountViewModel = accountViewModel, nav = nav)
|
||||||
@@ -433,7 +433,7 @@ internal fun ReviewEntry(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
is ReviewItem.Addressable ->
|
is ReviewItem.Addressable ->
|
||||||
LoadAddressableNote(item.address, accountViewModel) { note ->
|
LoadAddressableNote(item.address) { note ->
|
||||||
if (note != null) {
|
if (note != null) {
|
||||||
Column(EntryPadding) {
|
Column(EntryPadding) {
|
||||||
NoteCompose(note, makeItShort = true, quotesLeft = 1, accountViewModel = accountViewModel, nav = nav)
|
NoteCompose(note, makeItShort = true, quotesLeft = 1, accountViewModel = accountViewModel, nav = nav)
|
||||||
@@ -457,7 +457,7 @@ private fun PersonEntry(
|
|||||||
accountViewModel: AccountViewModel,
|
accountViewModel: AccountViewModel,
|
||||||
nav: INav,
|
nav: INav,
|
||||||
) {
|
) {
|
||||||
LoadUser(item.pubKey, accountViewModel) { user ->
|
LoadUser(item.pubKey) { user ->
|
||||||
if (user == null) {
|
if (user == null) {
|
||||||
TextEntry(item.pubKey.toShortDisplay(), item.detail)
|
TextEntry(item.pubKey.toShortDisplay(), item.detail)
|
||||||
} else {
|
} else {
|
||||||
@@ -482,7 +482,7 @@ private fun PublicChatEntry(
|
|||||||
accountViewModel: AccountViewModel,
|
accountViewModel: AccountViewModel,
|
||||||
nav: INav,
|
nav: INav,
|
||||||
) {
|
) {
|
||||||
LoadPublicChatChannel(item.channelId, accountViewModel) { channel ->
|
LoadPublicChatChannel(item.channelId) { channel ->
|
||||||
// Subscribes to the channel's metadata on relays and recomposes when it arrives.
|
// Subscribes to the channel's metadata on relays and recomposes when it arrives.
|
||||||
val state by observeChannel(channel, accountViewModel)
|
val state by observeChannel(channel, accountViewModel)
|
||||||
val name = state?.channel?.toBestDisplayName() ?: channel.toBestDisplayName()
|
val name = state?.channel?.toBestDisplayName() ?: channel.toBestDisplayName()
|
||||||
|
|||||||
+1
-1
@@ -208,7 +208,7 @@ private fun AwardRow(
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
LoadAddressableNote(defAddr, accountViewModel) { defNote ->
|
LoadAddressableNote(defAddr) { defNote ->
|
||||||
if (defNote == null) {
|
if (defNote == null) {
|
||||||
StaticAwardRow(
|
StaticAwardRow(
|
||||||
definition = null,
|
definition = null,
|
||||||
|
|||||||
+1
-1
@@ -59,7 +59,7 @@ fun ArticleBookmarkListManagementScreen(
|
|||||||
accountViewModel: AccountViewModel,
|
accountViewModel: AccountViewModel,
|
||||||
nav: INav,
|
nav: INav,
|
||||||
) {
|
) {
|
||||||
LoadAddressableNote(address = articleAddress, accountViewModel = accountViewModel) {
|
LoadAddressableNote(address = articleAddress) {
|
||||||
it?.let {
|
it?.let {
|
||||||
ListManagementView(
|
ListManagementView(
|
||||||
modifier = Modifier.fillMaxSize().recalculateWindowInsets(),
|
modifier = Modifier.fillMaxSize().recalculateWindowInsets(),
|
||||||
|
|||||||
+1
-1
@@ -58,7 +58,7 @@ fun PostBookmarkListManagementScreen(
|
|||||||
accountViewModel: AccountViewModel,
|
accountViewModel: AccountViewModel,
|
||||||
nav: INav,
|
nav: INav,
|
||||||
) {
|
) {
|
||||||
LoadNote(baseNoteHex = postId, accountViewModel = accountViewModel) {
|
LoadNote(baseNoteHex = postId) {
|
||||||
it?.let {
|
it?.let {
|
||||||
ListManagementView(
|
ListManagementView(
|
||||||
modifier = Modifier.fillMaxSize().recalculateWindowInsets(),
|
modifier = Modifier.fillMaxSize().recalculateWindowInsets(),
|
||||||
|
|||||||
+1
-1
@@ -450,7 +450,7 @@ private fun Person(
|
|||||||
Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(5.dp)) {
|
Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(5.dp)) {
|
||||||
Text(prefix, style = MaterialTheme.typography.labelSmall, color = MaterialTheme.colorScheme.onSurfaceVariant)
|
Text(prefix, style = MaterialTheme.typography.labelSmall, color = MaterialTheme.colorScheme.onSurfaceVariant)
|
||||||
UserPicture(userHex = hex, size = Size20dp, accountViewModel = accountViewModel, nav = nav)
|
UserPicture(userHex = hex, size = Size20dp, accountViewModel = accountViewModel, nav = nav)
|
||||||
LoadUser(baseUserHex = hex, accountViewModel = accountViewModel) { user ->
|
LoadUser(baseUserHex = hex) { user ->
|
||||||
if (user != null) UsernameDisplay(baseUser = user, fontWeight = FontWeight.Medium, accountViewModel = accountViewModel)
|
if (user != null) UsernameDisplay(baseUser = user, fontWeight = FontWeight.Medium, accountViewModel = accountViewModel)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -387,7 +387,7 @@ private fun Person(
|
|||||||
Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(5.dp)) {
|
Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(5.dp)) {
|
||||||
Text(prefix, style = MaterialTheme.typography.labelSmall, color = MaterialTheme.colorScheme.onSurfaceVariant)
|
Text(prefix, style = MaterialTheme.typography.labelSmall, color = MaterialTheme.colorScheme.onSurfaceVariant)
|
||||||
UserPicture(userHex = hex, size = Size20dp, accountViewModel = accountViewModel, nav = nav)
|
UserPicture(userHex = hex, size = Size20dp, accountViewModel = accountViewModel, nav = nav)
|
||||||
LoadUser(baseUserHex = hex, accountViewModel = accountViewModel) { user ->
|
LoadUser(baseUserHex = hex) { user ->
|
||||||
if (user != null) {
|
if (user != null) {
|
||||||
UsernameDisplay(baseUser = user, fontWeight = FontWeight.Medium, accountViewModel = accountViewModel)
|
UsernameDisplay(baseUser = user, fontWeight = FontWeight.Medium, accountViewModel = accountViewModel)
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -741,7 +741,7 @@ private fun Person(
|
|||||||
Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(5.dp)) {
|
Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(5.dp)) {
|
||||||
Text(prefix, style = MaterialTheme.typography.labelSmall, color = MaterialTheme.colorScheme.onSurfaceVariant)
|
Text(prefix, style = MaterialTheme.typography.labelSmall, color = MaterialTheme.colorScheme.onSurfaceVariant)
|
||||||
UserPicture(userHex = hex, size = Size20dp, accountViewModel = accountViewModel, nav = nav)
|
UserPicture(userHex = hex, size = Size20dp, accountViewModel = accountViewModel, nav = nav)
|
||||||
LoadUser(baseUserHex = hex, accountViewModel = accountViewModel) { user ->
|
LoadUser(baseUserHex = hex) { user ->
|
||||||
if (user != null) {
|
if (user != null) {
|
||||||
UsernameDisplay(baseUser = user, fontWeight = FontWeight.Medium, accountViewModel = accountViewModel)
|
UsernameDisplay(baseUser = user, fontWeight = FontWeight.Medium, accountViewModel = accountViewModel)
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -373,7 +373,7 @@ private fun ParticipantsRow(
|
|||||||
size = Size30dp,
|
size = Size30dp,
|
||||||
accountViewModel = accountViewModel,
|
accountViewModel = accountViewModel,
|
||||||
)
|
)
|
||||||
LoadUser(baseUserHex = pubKey, accountViewModel = accountViewModel) { user ->
|
LoadUser(baseUserHex = pubKey) { user ->
|
||||||
if (user != null) {
|
if (user != null) {
|
||||||
UsernameDisplay(
|
UsernameDisplay(
|
||||||
baseUser = user,
|
baseUser = user,
|
||||||
|
|||||||
+1
-1
@@ -774,7 +774,7 @@ private fun UserRow(
|
|||||||
nav: INav,
|
nav: INav,
|
||||||
trailing: (@Composable () -> Unit)?,
|
trailing: (@Composable () -> Unit)?,
|
||||||
) {
|
) {
|
||||||
LoadUser(baseUserHex = pubKey, accountViewModel = accountViewModel) { user ->
|
LoadUser(baseUserHex = pubKey) { user ->
|
||||||
Row(
|
Row(
|
||||||
modifier = Modifier.fillMaxWidth(),
|
modifier = Modifier.fillMaxWidth(),
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
|
|||||||
+1
-1
@@ -292,7 +292,7 @@ private fun RecipientDeliveryRow(
|
|||||||
horizontalArrangement = Arrangement.spacedBy(8.dp),
|
horizontalArrangement = Arrangement.spacedBy(8.dp),
|
||||||
modifier = Modifier.fillMaxWidth(),
|
modifier = Modifier.fillMaxWidth(),
|
||||||
) {
|
) {
|
||||||
LoadUser(baseUserHex = recipient.recipient, accountViewModel = accountViewModel) { user ->
|
LoadUser(baseUserHex = recipient.recipient) { user ->
|
||||||
if (user != null) {
|
if (user != null) {
|
||||||
UserPicture(user, Size20dp, Modifier, accountViewModel, nav)
|
UserPicture(user, Size20dp, Modifier, accountViewModel, nav)
|
||||||
Row(modifier = Modifier.weight(1f)) {
|
Row(modifier = Modifier.weight(1f)) {
|
||||||
|
|||||||
+1
-1
@@ -72,7 +72,7 @@ fun RenderChatClip(
|
|||||||
Row(verticalAlignment = Alignment.CenterVertically) {
|
Row(verticalAlignment = Alignment.CenterVertically) {
|
||||||
UserPicture(authorHex, Size20dp, Modifier, accountViewModel, nav)
|
UserPicture(authorHex, Size20dp, Modifier, accountViewModel, nav)
|
||||||
Spacer(StdHorzSpacer)
|
Spacer(StdHorzSpacer)
|
||||||
LoadUser(baseUserHex = authorHex, accountViewModel = accountViewModel) { user ->
|
LoadUser(baseUserHex = authorHex) { user ->
|
||||||
if (user != null) {
|
if (user != null) {
|
||||||
UsernameDisplay(
|
UsernameDisplay(
|
||||||
baseUser = user,
|
baseUser = user,
|
||||||
|
|||||||
+2
-2
@@ -84,7 +84,7 @@ fun RenderChatRaid(
|
|||||||
Row(verticalAlignment = Alignment.CenterVertically) {
|
Row(verticalAlignment = Alignment.CenterVertically) {
|
||||||
UserPicture(from.pubKeyHex, Size20dp, Modifier, accountViewModel, nav)
|
UserPicture(from.pubKeyHex, Size20dp, Modifier, accountViewModel, nav)
|
||||||
Spacer(StdHorzSpacer)
|
Spacer(StdHorzSpacer)
|
||||||
LoadUser(baseUserHex = from.pubKeyHex, accountViewModel = accountViewModel) { user ->
|
LoadUser(baseUserHex = from.pubKeyHex) { user ->
|
||||||
if (user != null) {
|
if (user != null) {
|
||||||
UsernameDisplay(
|
UsernameDisplay(
|
||||||
baseUser = user,
|
baseUser = user,
|
||||||
@@ -104,7 +104,7 @@ fun RenderChatRaid(
|
|||||||
|
|
||||||
UserPicture(to.pubKeyHex, Size20dp, Modifier, accountViewModel, nav)
|
UserPicture(to.pubKeyHex, Size20dp, Modifier, accountViewModel, nav)
|
||||||
Spacer(StdHorzSpacer)
|
Spacer(StdHorzSpacer)
|
||||||
LoadUser(baseUserHex = to.pubKeyHex, accountViewModel = accountViewModel) { user ->
|
LoadUser(baseUserHex = to.pubKeyHex) { user ->
|
||||||
if (user != null) {
|
if (user != null) {
|
||||||
UsernameDisplay(
|
UsernameDisplay(
|
||||||
baseUser = user,
|
baseUser = user,
|
||||||
|
|||||||
+4
-3
@@ -69,6 +69,7 @@ import com.vitorpamplona.amethyst.commons.ui.feeds.WatchLifecycleAndUpdateModel
|
|||||||
import com.vitorpamplona.amethyst.commons.ui.insets.imePaddingSafe
|
import com.vitorpamplona.amethyst.commons.ui.insets.imePaddingSafe
|
||||||
import com.vitorpamplona.amethyst.commons.ui.navigation.navs.INav
|
import com.vitorpamplona.amethyst.commons.ui.navigation.navs.INav
|
||||||
import com.vitorpamplona.amethyst.commons.ui.navigation.topbars.TopBarExtensibleWithBackButton
|
import com.vitorpamplona.amethyst.commons.ui.navigation.topbars.TopBarExtensibleWithBackButton
|
||||||
|
import com.vitorpamplona.amethyst.commons.ui.screen.LocalDisplaySettings
|
||||||
import com.vitorpamplona.amethyst.service.location.LocationState
|
import com.vitorpamplona.amethyst.service.location.LocationState
|
||||||
import com.vitorpamplona.amethyst.service.relayClient.reqCommand.user.observeUserPicture
|
import com.vitorpamplona.amethyst.service.relayClient.reqCommand.user.observeUserPicture
|
||||||
import com.vitorpamplona.amethyst.ui.layouts.DisappearingScaffold
|
import com.vitorpamplona.amethyst.ui.layouts.DisappearingScaffold
|
||||||
@@ -115,7 +116,7 @@ fun GeohashChatScreen(
|
|||||||
accountViewModel: AccountViewModel,
|
accountViewModel: AccountViewModel,
|
||||||
nav: INav,
|
nav: INav,
|
||||||
) {
|
) {
|
||||||
LoadGeohashChannel(geohash, accountViewModel) { channel ->
|
LoadGeohashChannel(geohash) { channel ->
|
||||||
GeohashChatRoom(channel, teleported, accountViewModel, nav)
|
GeohashChatRoom(channel, teleported, accountViewModel, nav)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -317,8 +318,8 @@ private fun GeohashIdentityAvatar(
|
|||||||
model = picture,
|
model = picture,
|
||||||
contentDescription = "Posting as yourself — tap to go anonymous, long-press for a nickname",
|
contentDescription = "Posting as yourself — tap to go anonymous, long-press for a nickname",
|
||||||
modifier = avatarModifier,
|
modifier = avatarModifier,
|
||||||
loadProfilePicture = accountViewModel.settings.showProfilePictures(),
|
loadProfilePicture = LocalDisplaySettings.current.showProfilePictures,
|
||||||
loadRobohash = accountViewModel.settings.isNotPerformanceMode(),
|
loadRobohash = LocalDisplaySettings.current.loadRobohash,
|
||||||
autoPlayGif = false,
|
autoPlayGif = false,
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
-2
@@ -24,7 +24,6 @@ import androidx.compose.runtime.Composable
|
|||||||
import com.vitorpamplona.amethyst.commons.model.cache.LocalCache
|
import com.vitorpamplona.amethyst.commons.model.cache.LocalCache
|
||||||
import com.vitorpamplona.amethyst.commons.model.geohashChat.GeohashChatChannel
|
import com.vitorpamplona.amethyst.commons.model.geohashChat.GeohashChatChannel
|
||||||
import com.vitorpamplona.amethyst.ui.note.produceStateIfNotNull
|
import com.vitorpamplona.amethyst.ui.note.produceStateIfNotNull
|
||||||
import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Resolves the [GeohashChatChannel] for [geohash] from LocalCache, creating an
|
* Resolves the [GeohashChatChannel] for [geohash] from LocalCache, creating an
|
||||||
@@ -35,7 +34,6 @@ import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel
|
|||||||
@Composable
|
@Composable
|
||||||
fun LoadGeohashChannel(
|
fun LoadGeohashChannel(
|
||||||
geohash: String,
|
geohash: String,
|
||||||
accountViewModel: AccountViewModel,
|
|
||||||
content: @Composable (GeohashChatChannel) -> Unit,
|
content: @Composable (GeohashChatChannel) -> Unit,
|
||||||
) {
|
) {
|
||||||
val channel =
|
val channel =
|
||||||
|
|||||||
+3
-2
@@ -45,6 +45,7 @@ import com.vitorpamplona.amethyst.commons.resources.marmot_change_photo
|
|||||||
import com.vitorpamplona.amethyst.commons.resources.marmot_group_icon
|
import com.vitorpamplona.amethyst.commons.resources.marmot_group_icon
|
||||||
import com.vitorpamplona.amethyst.commons.resources.marmot_remove_photo
|
import com.vitorpamplona.amethyst.commons.resources.marmot_remove_photo
|
||||||
import com.vitorpamplona.amethyst.commons.ui.components.RobohashFallbackAsyncImage
|
import com.vitorpamplona.amethyst.commons.ui.components.RobohashFallbackAsyncImage
|
||||||
|
import com.vitorpamplona.amethyst.commons.ui.screen.LocalDisplaySettings
|
||||||
import com.vitorpamplona.amethyst.commons.ui.stringRes
|
import com.vitorpamplona.amethyst.commons.ui.stringRes
|
||||||
import com.vitorpamplona.amethyst.ui.actions.uploads.SelectedMedia
|
import com.vitorpamplona.amethyst.ui.actions.uploads.SelectedMedia
|
||||||
import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel
|
import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel
|
||||||
@@ -99,8 +100,8 @@ fun MarmotGroupIconEditor(
|
|||||||
.size(96.dp)
|
.size(96.dp)
|
||||||
.clip(CircleShape)
|
.clip(CircleShape)
|
||||||
.let { if (enabled) it.clickable { launcher.launch(PickVisualMediaRequest(ActivityResultContracts.PickVisualMedia.ImageOnly)) } else it },
|
.let { if (enabled) it.clickable { launcher.launch(PickVisualMediaRequest(ActivityResultContracts.PickVisualMedia.ImageOnly)) } else it },
|
||||||
loadProfilePicture = accountViewModel.settings.showProfilePictures(),
|
loadProfilePicture = LocalDisplaySettings.current.showProfilePictures,
|
||||||
loadRobohash = accountViewModel.settings.isNotPerformanceMode(),
|
loadRobohash = LocalDisplaySettings.current.loadRobohash,
|
||||||
)
|
)
|
||||||
|
|
||||||
Row(
|
Row(
|
||||||
|
|||||||
+7
-6
@@ -132,6 +132,7 @@ import com.vitorpamplona.amethyst.commons.ui.insets.imePaddingSafe
|
|||||||
import com.vitorpamplona.amethyst.commons.ui.loadStringRes
|
import com.vitorpamplona.amethyst.commons.ui.loadStringRes
|
||||||
import com.vitorpamplona.amethyst.commons.ui.navigation.navs.INav
|
import com.vitorpamplona.amethyst.commons.ui.navigation.navs.INav
|
||||||
import com.vitorpamplona.amethyst.commons.ui.pluralStringRes
|
import com.vitorpamplona.amethyst.commons.ui.pluralStringRes
|
||||||
|
import com.vitorpamplona.amethyst.commons.ui.screen.LocalDisplaySettings
|
||||||
import com.vitorpamplona.amethyst.commons.ui.stringRes
|
import com.vitorpamplona.amethyst.commons.ui.stringRes
|
||||||
import com.vitorpamplona.amethyst.commons.ui.theme.MediumRelayIconModifier
|
import com.vitorpamplona.amethyst.commons.ui.theme.MediumRelayIconModifier
|
||||||
import com.vitorpamplona.amethyst.commons.ui.theme.SuggestionListDefaultHeightChat
|
import com.vitorpamplona.amethyst.commons.ui.theme.SuggestionListDefaultHeightChat
|
||||||
@@ -760,7 +761,7 @@ fun MemberRow(
|
|||||||
nav = nav,
|
nav = nav,
|
||||||
)
|
)
|
||||||
Column(modifier = Modifier.weight(1f)) {
|
Column(modifier = Modifier.weight(1f)) {
|
||||||
LoadUser(baseUserHex = member.pubkey, accountViewModel = accountViewModel) { user ->
|
LoadUser(baseUserHex = member.pubkey) { user ->
|
||||||
val displayName = user?.toBestDisplayName() ?: stringRes(Res.string.marmot_user_fallback_name, member.pubkey.take(16))
|
val displayName = user?.toBestDisplayName() ?: stringRes(Res.string.marmot_user_fallback_name, member.pubkey.take(16))
|
||||||
val youSuffix = stringRes(Res.string.marmot_member_suffix_you)
|
val youSuffix = stringRes(Res.string.marmot_member_suffix_you)
|
||||||
val adminSuffix = stringRes(Res.string.marmot_member_suffix_admin)
|
val adminSuffix = stringRes(Res.string.marmot_member_suffix_admin)
|
||||||
@@ -875,7 +876,7 @@ private fun ConfirmRemoveMemberDialog(
|
|||||||
onDismissRequest = onDismiss,
|
onDismissRequest = onDismiss,
|
||||||
title = { Text(stringRes(Res.string.marmot_remove_member)) },
|
title = { Text(stringRes(Res.string.marmot_remove_member)) },
|
||||||
text = {
|
text = {
|
||||||
LoadUser(baseUserHex = memberPubkey, accountViewModel = accountViewModel) { user ->
|
LoadUser(baseUserHex = memberPubkey) { user ->
|
||||||
val name = user?.toBestDisplayName() ?: stringRes(Res.string.marmot_user_fallback_name, memberPubkey.take(16))
|
val name = user?.toBestDisplayName() ?: stringRes(Res.string.marmot_user_fallback_name, memberPubkey.take(16))
|
||||||
Text(stringRes(Res.string.marmot_remove_member_confirm, name))
|
Text(stringRes(Res.string.marmot_remove_member_confirm, name))
|
||||||
}
|
}
|
||||||
@@ -904,7 +905,7 @@ private fun ConfirmGrantAdminDialog(
|
|||||||
onDismissRequest = onDismiss,
|
onDismissRequest = onDismiss,
|
||||||
title = { Text(stringRes(Res.string.marmot_grant_admin_title)) },
|
title = { Text(stringRes(Res.string.marmot_grant_admin_title)) },
|
||||||
text = {
|
text = {
|
||||||
LoadUser(baseUserHex = memberPubkey, accountViewModel = accountViewModel) { user ->
|
LoadUser(baseUserHex = memberPubkey) { user ->
|
||||||
val name = user?.toBestDisplayName() ?: stringRes(Res.string.marmot_user_fallback_name, memberPubkey.take(16))
|
val name = user?.toBestDisplayName() ?: stringRes(Res.string.marmot_user_fallback_name, memberPubkey.take(16))
|
||||||
Text(stringRes(Res.string.marmot_grant_admin_confirm, name))
|
Text(stringRes(Res.string.marmot_grant_admin_confirm, name))
|
||||||
}
|
}
|
||||||
@@ -933,7 +934,7 @@ private fun ConfirmRevokeAdminDialog(
|
|||||||
onDismissRequest = onDismiss,
|
onDismissRequest = onDismiss,
|
||||||
title = { Text(stringRes(Res.string.marmot_revoke_admin_title)) },
|
title = { Text(stringRes(Res.string.marmot_revoke_admin_title)) },
|
||||||
text = {
|
text = {
|
||||||
LoadUser(baseUserHex = memberPubkey, accountViewModel = accountViewModel) { user ->
|
LoadUser(baseUserHex = memberPubkey) { user ->
|
||||||
val name = user?.toBestDisplayName() ?: stringRes(Res.string.marmot_user_fallback_name, memberPubkey.take(16))
|
val name = user?.toBestDisplayName() ?: stringRes(Res.string.marmot_user_fallback_name, memberPubkey.take(16))
|
||||||
Text(stringRes(Res.string.marmot_revoke_admin_confirm, name))
|
Text(stringRes(Res.string.marmot_revoke_admin_confirm, name))
|
||||||
}
|
}
|
||||||
@@ -1025,9 +1026,9 @@ fun GroupRelayTile(
|
|||||||
RenderRelayIcon(
|
RenderRelayIcon(
|
||||||
displayUrl = relayInfo.id ?: fallbackUrl,
|
displayUrl = relayInfo.id ?: fallbackUrl,
|
||||||
iconUrl = relayInfo.icon,
|
iconUrl = relayInfo.icon,
|
||||||
loadProfilePicture = accountViewModel.settings.showProfilePictures(),
|
loadProfilePicture = LocalDisplaySettings.current.showProfilePictures,
|
||||||
pingInMs = 0,
|
pingInMs = 0,
|
||||||
loadRobohash = accountViewModel.settings.isNotPerformanceMode(),
|
loadRobohash = LocalDisplaySettings.current.loadRobohash,
|
||||||
iconModifier = MediumRelayIconModifier,
|
iconModifier = MediumRelayIconModifier,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
-1
@@ -131,7 +131,6 @@ fun ChatroomView(
|
|||||||
for (userHex in room.users) {
|
for (userHex in room.users) {
|
||||||
LoadAddressableNote(
|
LoadAddressableNote(
|
||||||
ChatMessageRelayListEvent.createAddress(userHex),
|
ChatMessageRelayListEvent.createAddress(userHex),
|
||||||
accountViewModel,
|
|
||||||
) { note ->
|
) { note ->
|
||||||
if (note != null) {
|
if (note != null) {
|
||||||
EventFinderFilterAssemblerSubscription(note, accountViewModel)
|
EventFinderFilterAssemblerSubscription(note, accountViewModel)
|
||||||
|
|||||||
+1
-1
@@ -49,7 +49,7 @@ fun ChatroomHeader(
|
|||||||
onClick: () -> Unit,
|
onClick: () -> Unit,
|
||||||
) {
|
) {
|
||||||
if (room.users.size == 1) {
|
if (room.users.size == 1) {
|
||||||
LoadUser(baseUserHex = room.users.first(), accountViewModel) { baseUser ->
|
LoadUser(baseUserHex = room.users.first()) { baseUser ->
|
||||||
if (baseUser != null) {
|
if (baseUser != null) {
|
||||||
UserChatroomHeader(
|
UserChatroomHeader(
|
||||||
baseUser = baseUser,
|
baseUser = baseUser,
|
||||||
|
|||||||
+1
-1
@@ -96,7 +96,7 @@ fun DmReportWarningCard(
|
|||||||
) {
|
) {
|
||||||
val counterpartHex = room.users.singleOrNull() ?: return
|
val counterpartHex = room.users.singleOrNull() ?: return
|
||||||
|
|
||||||
LoadUser(baseUserHex = counterpartHex, accountViewModel = accountViewModel) { user ->
|
LoadUser(baseUserHex = counterpartHex) { user ->
|
||||||
if (user != null) {
|
if (user != null) {
|
||||||
val flow = remember(user) { accountViewModel.createUserReportWarningFlow(user) }
|
val flow = remember(user) { accountViewModel.createUserReportWarningFlow(user) }
|
||||||
val state by flow.collectAsStateWithLifecycle()
|
val state by flow.collectAsStateWithLifecycle()
|
||||||
|
|||||||
+3
-3
@@ -81,7 +81,7 @@ fun RenderRoomTopBar(
|
|||||||
if (room.users.size == 1) {
|
if (room.users.size == 1) {
|
||||||
TopBarExtensibleWithBackButton(
|
TopBarExtensibleWithBackButton(
|
||||||
title = {
|
title = {
|
||||||
LoadUser(baseUserHex = room.users.first(), accountViewModel) { baseUser ->
|
LoadUser(baseUserHex = room.users.first()) { baseUser ->
|
||||||
if (baseUser != null) {
|
if (baseUser != null) {
|
||||||
ClickableUserPicture(
|
ClickableUserPicture(
|
||||||
baseUser = baseUser,
|
baseUser = baseUser,
|
||||||
@@ -124,7 +124,7 @@ fun RenderRoomTopBar(
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
extendableRow = {
|
extendableRow = {
|
||||||
LoadUser(baseUserHex = room.users.first(), accountViewModel) {
|
LoadUser(baseUserHex = room.users.first()) {
|
||||||
if (it != null) {
|
if (it != null) {
|
||||||
UserCompose(
|
UserCompose(
|
||||||
baseUser = it,
|
baseUser = it,
|
||||||
@@ -216,7 +216,7 @@ fun GroupMembersHeader(
|
|||||||
state = rememberLazyListState(),
|
state = rememberLazyListState(),
|
||||||
) {
|
) {
|
||||||
itemsIndexed(list, key = { _, item -> item }) { _, item ->
|
itemsIndexed(list, key = { _, item -> item }) { _, item ->
|
||||||
LoadUser(baseUserHex = item, accountViewModel) {
|
LoadUser(baseUserHex = item) {
|
||||||
if (it != null) {
|
if (it != null) {
|
||||||
UserCompose(
|
UserCompose(
|
||||||
baseUser = it,
|
baseUser = it,
|
||||||
|
|||||||
+2
-2
@@ -81,14 +81,14 @@ fun DisplayUserSetAsSubject(
|
|||||||
if (userList.size == 1) {
|
if (userList.size == 1) {
|
||||||
// Regular Design
|
// Regular Design
|
||||||
Row {
|
Row {
|
||||||
LoadUser(baseUserHex = userList[0], accountViewModel) {
|
LoadUser(baseUserHex = userList[0]) {
|
||||||
it?.let { UsernameDisplay(it, Modifier.weight(1f), fontWeight = fontWeight, accountViewModel = accountViewModel) }
|
it?.let { UsernameDisplay(it, Modifier.weight(1f), fontWeight = fontWeight, accountViewModel = accountViewModel) }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Row {
|
Row {
|
||||||
userList.take(4).forEachIndexed { index, value ->
|
userList.take(4).forEachIndexed { index, value ->
|
||||||
LoadUser(baseUserHex = value, accountViewModel) {
|
LoadUser(baseUserHex = value) {
|
||||||
it?.let { ShortUsernameDisplay(baseUser = it, fontWeight = fontWeight, accountViewModel = accountViewModel) }
|
it?.let { ShortUsernameDisplay(baseUser = it, fontWeight = fontWeight, accountViewModel = accountViewModel) }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+3
-2
@@ -72,6 +72,7 @@ import com.vitorpamplona.amethyst.commons.ui.navigation.bottombars.FabBottomBarP
|
|||||||
import com.vitorpamplona.amethyst.commons.ui.navigation.navs.INav
|
import com.vitorpamplona.amethyst.commons.ui.navigation.navs.INav
|
||||||
import com.vitorpamplona.amethyst.commons.ui.navigation.topbars.ShorterTopAppBar
|
import com.vitorpamplona.amethyst.commons.ui.navigation.topbars.ShorterTopAppBar
|
||||||
import com.vitorpamplona.amethyst.commons.ui.pluralStringRes
|
import com.vitorpamplona.amethyst.commons.ui.pluralStringRes
|
||||||
|
import com.vitorpamplona.amethyst.commons.ui.screen.LocalDisplaySettings
|
||||||
import com.vitorpamplona.amethyst.commons.ui.stringRes
|
import com.vitorpamplona.amethyst.commons.ui.stringRes
|
||||||
import com.vitorpamplona.amethyst.model.Account
|
import com.vitorpamplona.amethyst.model.Account
|
||||||
import com.vitorpamplona.amethyst.service.relayClient.reqCommand.user.observeUserName
|
import com.vitorpamplona.amethyst.service.relayClient.reqCommand.user.observeUserName
|
||||||
@@ -313,8 +314,8 @@ private fun CommunityHeader(
|
|||||||
model = iconModel,
|
model = iconModel,
|
||||||
contentDescription = name,
|
contentDescription = name,
|
||||||
modifier = Modifier.size(40.dp).clip(CircleShape).clickable(onClick = onOpen),
|
modifier = Modifier.size(40.dp).clip(CircleShape).clickable(onClick = onOpen),
|
||||||
loadProfilePicture = accountViewModel.settings.showProfilePictures(),
|
loadProfilePicture = LocalDisplaySettings.current.showProfilePictures,
|
||||||
loadRobohash = accountViewModel.settings.isNotPerformanceMode(),
|
loadRobohash = LocalDisplaySettings.current.loadRobohash,
|
||||||
autoPlayGif = autoPlayGif,
|
autoPlayGif = autoPlayGif,
|
||||||
)
|
)
|
||||||
// The identity block — icon *and* name/subtitle — opens the community; the rest of the row and
|
// The identity block — icon *and* name/subtitle — opens the community; the rest of the row and
|
||||||
|
|||||||
+5
-4
@@ -78,6 +78,7 @@ import com.vitorpamplona.amethyst.commons.ui.components.RobohashFallbackAsyncIma
|
|||||||
import com.vitorpamplona.amethyst.commons.ui.components.util.setText
|
import com.vitorpamplona.amethyst.commons.ui.components.util.setText
|
||||||
import com.vitorpamplona.amethyst.commons.ui.loadStringRes
|
import com.vitorpamplona.amethyst.commons.ui.loadStringRes
|
||||||
import com.vitorpamplona.amethyst.commons.ui.navigation.navs.INav
|
import com.vitorpamplona.amethyst.commons.ui.navigation.navs.INav
|
||||||
|
import com.vitorpamplona.amethyst.commons.ui.screen.LocalDisplaySettings
|
||||||
import com.vitorpamplona.amethyst.commons.ui.stringRes
|
import com.vitorpamplona.amethyst.commons.ui.stringRes
|
||||||
import com.vitorpamplona.amethyst.commons.ui.theme.MediumRelayIconModifier
|
import com.vitorpamplona.amethyst.commons.ui.theme.MediumRelayIconModifier
|
||||||
import com.vitorpamplona.amethyst.model.nip11RelayInfo.loadRelayInfo
|
import com.vitorpamplona.amethyst.model.nip11RelayInfo.loadRelayInfo
|
||||||
@@ -193,8 +194,8 @@ private fun ConcordIconHero(
|
|||||||
model = iconModel,
|
model = iconModel,
|
||||||
contentDescription = displayName.ifBlank { stringRes(Res.string.concord_create_title) },
|
contentDescription = displayName.ifBlank { stringRes(Res.string.concord_create_title) },
|
||||||
modifier = Modifier.size(104.dp).clip(CircleShape),
|
modifier = Modifier.size(104.dp).clip(CircleShape),
|
||||||
loadProfilePicture = accountViewModel.settings.showProfilePictures(),
|
loadProfilePicture = LocalDisplaySettings.current.showProfilePictures,
|
||||||
loadRobohash = accountViewModel.settings.isNotPerformanceMode(),
|
loadRobohash = LocalDisplaySettings.current.loadRobohash,
|
||||||
autoPlayGif = autoPlayGif,
|
autoPlayGif = autoPlayGif,
|
||||||
)
|
)
|
||||||
if (uploading) CircularProgressIndicator(modifier = Modifier.size(36.dp))
|
if (uploading) CircularProgressIndicator(modifier = Modifier.size(36.dp))
|
||||||
@@ -345,8 +346,8 @@ private fun ConcordRelayRow(
|
|||||||
RenderRelayIcon(
|
RenderRelayIcon(
|
||||||
displayUrl = relayInfo.id ?: relay.displayUrl(),
|
displayUrl = relayInfo.id ?: relay.displayUrl(),
|
||||||
iconUrl = relayInfo.icon,
|
iconUrl = relayInfo.icon,
|
||||||
loadProfilePicture = accountViewModel.settings.showProfilePictures(),
|
loadProfilePicture = LocalDisplaySettings.current.showProfilePictures,
|
||||||
loadRobohash = accountViewModel.settings.isNotPerformanceMode(),
|
loadRobohash = LocalDisplaySettings.current.loadRobohash,
|
||||||
pingInMs = 0,
|
pingInMs = 0,
|
||||||
iconModifier = MediumRelayIconModifier,
|
iconModifier = MediumRelayIconModifier,
|
||||||
)
|
)
|
||||||
|
|||||||
+1
-1
@@ -53,7 +53,7 @@ fun EphemeralChatChannelView(
|
|||||||
) {
|
) {
|
||||||
if (channelId == null) return
|
if (channelId == null) return
|
||||||
|
|
||||||
LoadEphemeralChatChannel(channelId, accountViewModel) { ephem ->
|
LoadEphemeralChatChannel(channelId) { ephem ->
|
||||||
PrepareChannelViewModels(
|
PrepareChannelViewModels(
|
||||||
baseChannel = ephem,
|
baseChannel = ephem,
|
||||||
draft = draft,
|
draft = draft,
|
||||||
|
|||||||
+1
-1
@@ -51,7 +51,7 @@ fun EphemeralChatScreen(
|
|||||||
DisappearingScaffold(
|
DisappearingScaffold(
|
||||||
isInvertedLayout = true,
|
isInvertedLayout = true,
|
||||||
topBar = {
|
topBar = {
|
||||||
LoadEphemeralChatChannel(channelId, accountViewModel) {
|
LoadEphemeralChatChannel(channelId) {
|
||||||
EphemeralChatTopBar(it, accountViewModel, nav)
|
EphemeralChatTopBar(it, accountViewModel, nav)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
-2
@@ -24,13 +24,11 @@ import androidx.compose.runtime.Composable
|
|||||||
import com.vitorpamplona.amethyst.commons.model.cache.LocalCache
|
import com.vitorpamplona.amethyst.commons.model.cache.LocalCache
|
||||||
import com.vitorpamplona.amethyst.commons.model.emphChat.EphemeralChatChannel
|
import com.vitorpamplona.amethyst.commons.model.emphChat.EphemeralChatChannel
|
||||||
import com.vitorpamplona.amethyst.ui.note.produceStateIfNotNull
|
import com.vitorpamplona.amethyst.ui.note.produceStateIfNotNull
|
||||||
import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel
|
|
||||||
import com.vitorpamplona.quartz.experimental.ephemChat.chat.RoomId
|
import com.vitorpamplona.quartz.experimental.ephemChat.chat.RoomId
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun LoadEphemeralChatChannel(
|
fun LoadEphemeralChatChannel(
|
||||||
id: RoomId,
|
id: RoomId,
|
||||||
accountViewModel: AccountViewModel,
|
|
||||||
content: @Composable (EphemeralChatChannel) -> Unit,
|
content: @Composable (EphemeralChatChannel) -> Unit,
|
||||||
) {
|
) {
|
||||||
val channel =
|
val channel =
|
||||||
|
|||||||
+3
-2
@@ -42,6 +42,7 @@ import com.vitorpamplona.amethyst.commons.resources.Res
|
|||||||
import com.vitorpamplona.amethyst.commons.resources.profile_image
|
import com.vitorpamplona.amethyst.commons.resources.profile_image
|
||||||
import com.vitorpamplona.amethyst.commons.ui.components.RobohashFallbackAsyncImage
|
import com.vitorpamplona.amethyst.commons.ui.components.RobohashFallbackAsyncImage
|
||||||
import com.vitorpamplona.amethyst.commons.ui.navigation.navs.INav
|
import com.vitorpamplona.amethyst.commons.ui.navigation.navs.INav
|
||||||
|
import com.vitorpamplona.amethyst.commons.ui.screen.LocalDisplaySettings
|
||||||
import com.vitorpamplona.amethyst.commons.ui.stringRes
|
import com.vitorpamplona.amethyst.commons.ui.stringRes
|
||||||
import com.vitorpamplona.amethyst.commons.ui.theme.HeaderPictureModifier
|
import com.vitorpamplona.amethyst.commons.ui.theme.HeaderPictureModifier
|
||||||
import com.vitorpamplona.amethyst.commons.ui.theme.Size35dp
|
import com.vitorpamplona.amethyst.commons.ui.theme.Size35dp
|
||||||
@@ -103,8 +104,8 @@ private fun DrawRelayIcon(
|
|||||||
contentDescription = stringRes(Res.string.profile_image),
|
contentDescription = stringRes(Res.string.profile_image),
|
||||||
contentScale = ContentScale.Crop,
|
contentScale = ContentScale.Crop,
|
||||||
modifier = HeaderPictureModifier,
|
modifier = HeaderPictureModifier,
|
||||||
loadProfilePicture = accountViewModel.settings.showProfilePictures(),
|
loadProfilePicture = LocalDisplaySettings.current.showProfilePictures,
|
||||||
loadRobohash = accountViewModel.settings.isNotPerformanceMode(),
|
loadRobohash = LocalDisplaySettings.current.loadRobohash,
|
||||||
autoPlayGif =
|
autoPlayGif =
|
||||||
accountViewModel.settings.autoPlayVideosFlow
|
accountViewModel.settings.autoPlayVideosFlow
|
||||||
.collectAsStateWithLifecycle()
|
.collectAsStateWithLifecycle()
|
||||||
|
|||||||
+1
-1
@@ -53,7 +53,7 @@ fun PublicChatChannelView(
|
|||||||
) {
|
) {
|
||||||
if (channelId == null) return
|
if (channelId == null) return
|
||||||
|
|
||||||
LoadPublicChatChannel(channelId, accountViewModel) {
|
LoadPublicChatChannel(channelId) {
|
||||||
PrepareChannelViewModels(
|
PrepareChannelViewModels(
|
||||||
baseChannel = it,
|
baseChannel = it,
|
||||||
draft = draft,
|
draft = draft,
|
||||||
|
|||||||
+1
-1
@@ -57,7 +57,7 @@ fun PublicChatChannelHeader(
|
|||||||
accountViewModel: AccountViewModel,
|
accountViewModel: AccountViewModel,
|
||||||
nav: INav,
|
nav: INav,
|
||||||
) {
|
) {
|
||||||
LoadPublicChatChannel(channelHex, accountViewModel) {
|
LoadPublicChatChannel(channelHex) {
|
||||||
PublicChatChannelHeader(
|
PublicChatChannelHeader(
|
||||||
it,
|
it,
|
||||||
sendToChannel,
|
sendToChannel,
|
||||||
|
|||||||
+1
-1
@@ -52,7 +52,7 @@ fun PublicChatChannelScreen(
|
|||||||
DisappearingScaffold(
|
DisappearingScaffold(
|
||||||
isInvertedLayout = true,
|
isInvertedLayout = true,
|
||||||
topBar = {
|
topBar = {
|
||||||
LoadPublicChatChannel(channelId, accountViewModel) {
|
LoadPublicChatChannel(channelId) {
|
||||||
PublicChatTopBar(it, accountViewModel, nav)
|
PublicChatTopBar(it, accountViewModel, nav)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
+4
-3
@@ -53,6 +53,7 @@ import com.vitorpamplona.amethyst.commons.resources.owner
|
|||||||
import com.vitorpamplona.amethyst.commons.ui.components.RobohashFallbackAsyncImage
|
import com.vitorpamplona.amethyst.commons.ui.components.RobohashFallbackAsyncImage
|
||||||
import com.vitorpamplona.amethyst.commons.ui.navigation.navs.INav
|
import com.vitorpamplona.amethyst.commons.ui.navigation.navs.INav
|
||||||
import com.vitorpamplona.amethyst.commons.ui.richtext.CreateTextWithEmoji
|
import com.vitorpamplona.amethyst.commons.ui.richtext.CreateTextWithEmoji
|
||||||
|
import com.vitorpamplona.amethyst.commons.ui.screen.LocalDisplaySettings
|
||||||
import com.vitorpamplona.amethyst.commons.ui.stringRes
|
import com.vitorpamplona.amethyst.commons.ui.stringRes
|
||||||
import com.vitorpamplona.amethyst.commons.ui.theme.DoubleHorzSpacer
|
import com.vitorpamplona.amethyst.commons.ui.theme.DoubleHorzSpacer
|
||||||
import com.vitorpamplona.amethyst.commons.ui.theme.Size25dp
|
import com.vitorpamplona.amethyst.commons.ui.theme.Size25dp
|
||||||
@@ -94,8 +95,8 @@ fun LongPublicChatChannelHeader(
|
|||||||
model = it,
|
model = it,
|
||||||
contentDescription = stringRes(Res.string.channel_image),
|
contentDescription = stringRes(Res.string.channel_image),
|
||||||
modifier = MaterialTheme.colorScheme.largeProfilePictureModifier,
|
modifier = MaterialTheme.colorScheme.largeProfilePictureModifier,
|
||||||
loadProfilePicture = accountViewModel.settings.showProfilePictures(),
|
loadProfilePicture = LocalDisplaySettings.current.showProfilePictures,
|
||||||
loadRobohash = accountViewModel.settings.isNotPerformanceMode(),
|
loadRobohash = LocalDisplaySettings.current.loadRobohash,
|
||||||
autoPlayGif =
|
autoPlayGif =
|
||||||
accountViewModel.settings.autoPlayVideosFlow
|
accountViewModel.settings.autoPlayVideosFlow
|
||||||
.collectAsStateWithLifecycle()
|
.collectAsStateWithLifecycle()
|
||||||
@@ -144,7 +145,7 @@ fun LongPublicChatChannelHeader(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LoadNote(baseNoteHex = channel.idHex, accountViewModel) { loadingNote ->
|
LoadNote(baseNoteHex = channel.idHex) { loadingNote ->
|
||||||
loadingNote?.let { note ->
|
loadingNote?.let { note ->
|
||||||
Row(
|
Row(
|
||||||
lineModifier,
|
lineModifier,
|
||||||
|
|||||||
+4
-3
@@ -43,6 +43,7 @@ import com.vitorpamplona.amethyst.commons.resources.Res
|
|||||||
import com.vitorpamplona.amethyst.commons.resources.profile_image
|
import com.vitorpamplona.amethyst.commons.resources.profile_image
|
||||||
import com.vitorpamplona.amethyst.commons.ui.components.RobohashFallbackAsyncImage
|
import com.vitorpamplona.amethyst.commons.ui.components.RobohashFallbackAsyncImage
|
||||||
import com.vitorpamplona.amethyst.commons.ui.navigation.navs.INav
|
import com.vitorpamplona.amethyst.commons.ui.navigation.navs.INav
|
||||||
|
import com.vitorpamplona.amethyst.commons.ui.screen.LocalDisplaySettings
|
||||||
import com.vitorpamplona.amethyst.commons.ui.stringRes
|
import com.vitorpamplona.amethyst.commons.ui.stringRes
|
||||||
import com.vitorpamplona.amethyst.commons.ui.theme.HeaderPictureModifier
|
import com.vitorpamplona.amethyst.commons.ui.theme.HeaderPictureModifier
|
||||||
import com.vitorpamplona.amethyst.commons.ui.theme.RowColSpacing
|
import com.vitorpamplona.amethyst.commons.ui.theme.RowColSpacing
|
||||||
@@ -72,8 +73,8 @@ fun ShortPublicChatChannelHeader(
|
|||||||
contentDescription = stringRes(Res.string.profile_image),
|
contentDescription = stringRes(Res.string.profile_image),
|
||||||
contentScale = ContentScale.Crop,
|
contentScale = ContentScale.Crop,
|
||||||
modifier = HeaderPictureModifier,
|
modifier = HeaderPictureModifier,
|
||||||
loadProfilePicture = accountViewModel.settings.showProfilePictures(),
|
loadProfilePicture = LocalDisplaySettings.current.showProfilePictures,
|
||||||
loadRobohash = accountViewModel.settings.isNotPerformanceMode(),
|
loadRobohash = LocalDisplaySettings.current.loadRobohash,
|
||||||
autoPlayGif =
|
autoPlayGif =
|
||||||
accountViewModel.settings.autoPlayVideosFlow
|
accountViewModel.settings.autoPlayVideosFlow
|
||||||
.collectAsStateWithLifecycle()
|
.collectAsStateWithLifecycle()
|
||||||
@@ -115,7 +116,7 @@ fun ShortChannelActionOptions(
|
|||||||
accountViewModel: AccountViewModel,
|
accountViewModel: AccountViewModel,
|
||||||
nav: INav,
|
nav: INav,
|
||||||
) {
|
) {
|
||||||
LoadNote(baseNoteHex = channel.idHex, accountViewModel) {
|
LoadNote(baseNoteHex = channel.idHex) {
|
||||||
it?.let {
|
it?.let {
|
||||||
Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = RowColSpacing) {
|
Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = RowColSpacing) {
|
||||||
LikeReaction(
|
LikeReaction(
|
||||||
|
|||||||
+1
-1
@@ -94,7 +94,7 @@ fun ChannelMetadataScreen(
|
|||||||
if (channelId == null) {
|
if (channelId == null) {
|
||||||
ChannelMetadataScreen(null as PublicChatChannel?, accountViewModel, nav)
|
ChannelMetadataScreen(null as PublicChatChannel?, accountViewModel, nav)
|
||||||
} else {
|
} else {
|
||||||
LoadPublicChatChannel(channelId, accountViewModel) {
|
LoadPublicChatChannel(channelId) {
|
||||||
ChannelMetadataScreen(it, accountViewModel, nav)
|
ChannelMetadataScreen(it, accountViewModel, nav)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -56,7 +56,7 @@ fun LiveActivityChannelView(
|
|||||||
) {
|
) {
|
||||||
if (channelId == null) return
|
if (channelId == null) return
|
||||||
|
|
||||||
LoadLiveActivityChannel(channelId, accountViewModel) {
|
LoadLiveActivityChannel(channelId) {
|
||||||
PrepareChannelViewModels(
|
PrepareChannelViewModels(
|
||||||
baseChannel = it,
|
baseChannel = it,
|
||||||
draft = draft,
|
draft = draft,
|
||||||
|
|||||||
+1
-1
@@ -52,7 +52,7 @@ fun LiveActivityChannelScreen(
|
|||||||
DisappearingScaffold(
|
DisappearingScaffold(
|
||||||
isInvertedLayout = true,
|
isInvertedLayout = true,
|
||||||
topBar = {
|
topBar = {
|
||||||
LoadLiveActivityChannel(channelId, accountViewModel) {
|
LoadLiveActivityChannel(channelId) {
|
||||||
LaunchedEffect(it.info) {
|
LaunchedEffect(it.info) {
|
||||||
it.info?.streaming()?.let {
|
it.info?.streaming()?.let {
|
||||||
OnlineChecker.resetIfOfflineToRetry(it)
|
OnlineChecker.resetIfOfflineToRetry(it)
|
||||||
|
|||||||
+1
-1
@@ -63,7 +63,7 @@ fun LiveStreamGoalHeader(
|
|||||||
) {
|
) {
|
||||||
val goalId = channel.info?.goalEventId() ?: return
|
val goalId = channel.info?.goalEventId() ?: return
|
||||||
|
|
||||||
LoadNote(baseNoteHex = goalId, accountViewModel = accountViewModel) { goalNote ->
|
LoadNote(baseNoteHex = goalId) { goalNote ->
|
||||||
if (goalNote != null) {
|
if (goalNote != null) {
|
||||||
GoalHeaderContent(goalNote, accountViewModel, nav)
|
GoalHeaderContent(goalNote, accountViewModel, nav)
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -91,7 +91,7 @@ fun LongLiveActivityChannelHeader(
|
|||||||
RenderSummary(activity, callbackUri, accountViewModel, nav)
|
RenderSummary(activity, callbackUri, accountViewModel, nav)
|
||||||
}
|
}
|
||||||
|
|
||||||
LoadAddressableNote(channel.address, accountViewModel) { loadingNote ->
|
LoadAddressableNote(channel.address) { loadingNote ->
|
||||||
loadingNote?.let { note ->
|
loadingNote?.let { note ->
|
||||||
Row(
|
Row(
|
||||||
lineModifier,
|
lineModifier,
|
||||||
|
|||||||
-2
@@ -24,13 +24,11 @@ import androidx.compose.runtime.Composable
|
|||||||
import com.vitorpamplona.amethyst.commons.model.cache.LocalCache
|
import com.vitorpamplona.amethyst.commons.model.cache.LocalCache
|
||||||
import com.vitorpamplona.amethyst.commons.model.nip29RelayGroups.RelayGroupChannel
|
import com.vitorpamplona.amethyst.commons.model.nip29RelayGroups.RelayGroupChannel
|
||||||
import com.vitorpamplona.amethyst.ui.note.produceStateIfNotNull
|
import com.vitorpamplona.amethyst.ui.note.produceStateIfNotNull
|
||||||
import com.vitorpamplona.amethyst.ui.screen.loggedIn.AccountViewModel
|
|
||||||
import com.vitorpamplona.quartz.nip29RelayGroups.GroupId
|
import com.vitorpamplona.quartz.nip29RelayGroups.GroupId
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun LoadRelayGroupChannel(
|
fun LoadRelayGroupChannel(
|
||||||
id: GroupId,
|
id: GroupId,
|
||||||
accountViewModel: AccountViewModel,
|
|
||||||
content: @Composable (RelayGroupChannel) -> Unit,
|
content: @Composable (RelayGroupChannel) -> Unit,
|
||||||
) {
|
) {
|
||||||
val channel =
|
val channel =
|
||||||
|
|||||||
+3
-2
@@ -99,6 +99,7 @@ import com.vitorpamplona.amethyst.commons.ui.components.RobohashFallbackAsyncIma
|
|||||||
import com.vitorpamplona.amethyst.commons.ui.navigation.navs.INav
|
import com.vitorpamplona.amethyst.commons.ui.navigation.navs.INav
|
||||||
import com.vitorpamplona.amethyst.commons.ui.navigation.topbars.TopBarExtensibleWithBackButton
|
import com.vitorpamplona.amethyst.commons.ui.navigation.topbars.TopBarExtensibleWithBackButton
|
||||||
import com.vitorpamplona.amethyst.commons.ui.pluralStringRes
|
import com.vitorpamplona.amethyst.commons.ui.pluralStringRes
|
||||||
|
import com.vitorpamplona.amethyst.commons.ui.screen.LocalDisplaySettings
|
||||||
import com.vitorpamplona.amethyst.commons.ui.stringRes
|
import com.vitorpamplona.amethyst.commons.ui.stringRes
|
||||||
import com.vitorpamplona.amethyst.commons.ui.theme.warningColor
|
import com.vitorpamplona.amethyst.commons.ui.theme.warningColor
|
||||||
import com.vitorpamplona.amethyst.commons.util.sortedBySnapshot
|
import com.vitorpamplona.amethyst.commons.util.sortedBySnapshot
|
||||||
@@ -973,8 +974,8 @@ private fun RelayGroupChannelRow(
|
|||||||
model = channel.profilePicture(),
|
model = channel.profilePicture(),
|
||||||
contentDescription = channel.toBestDisplayName(),
|
contentDescription = channel.toBestDisplayName(),
|
||||||
modifier = Modifier.size(40.dp).clip(CircleShape),
|
modifier = Modifier.size(40.dp).clip(CircleShape),
|
||||||
loadProfilePicture = accountViewModel.settings.showProfilePictures(),
|
loadProfilePicture = LocalDisplaySettings.current.showProfilePictures,
|
||||||
loadRobohash = accountViewModel.settings.isNotPerformanceMode(),
|
loadRobohash = LocalDisplaySettings.current.loadRobohash,
|
||||||
autoPlayGif = autoPlayGif,
|
autoPlayGif = autoPlayGif,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user