Merge branch 'vitorpamplona:main' into kmp-completeness
This commit is contained in:
+20
-6
@@ -1,8 +1,14 @@
|
|||||||
# Amethyst Desktop Fork
|
# Amethyst
|
||||||
|
|
||||||
## Project Overview
|
## Project Overview
|
||||||
|
|
||||||
Fork of [Amethyst](https://github.com/vitorpamplona/amethyst) adding Compose Multiplatform Desktop support. Quartz library converted to full KMP for code sharing between Android and Desktop JVM.
|
Amethyst is a Nostr Client for Android that was made for Android-only and has been slowly switching
|
||||||
|
over to a Kotlin Multiplatform project. This project has 4 main modules: `quartz`, `commons`,
|
||||||
|
`amethyst` and `desktopApp`. Quartz should contain implementations of Nostr specifications and
|
||||||
|
utilities to help implement them. Commons stores shared code between Amethyst Android (`amethyst`)
|
||||||
|
and Amethyst Desktop (`desktopApp`). The Desktop App is designed to be mouse first and so uses a
|
||||||
|
completely different screen and navigation architecture while sharing the back end components with
|
||||||
|
the android counterpart.
|
||||||
|
|
||||||
## Architecture
|
## Architecture
|
||||||
|
|
||||||
@@ -12,7 +18,8 @@ amethyst/
|
|||||||
│ └── src/
|
│ └── src/
|
||||||
│ ├── commonMain/ # Shared Nostr protocol, data models
|
│ ├── commonMain/ # Shared Nostr protocol, data models
|
||||||
│ ├── androidMain/ # Android-specific (crypto, storage)
|
│ ├── androidMain/ # Android-specific (crypto, storage)
|
||||||
│ └── jvmMain/ # Desktop JVM-specific
|
│ ├── jvmMain/ # Desktop JVM-specific
|
||||||
|
│ └── iosMain/ # iOS-specific
|
||||||
├── commons/ # Shared UI components (convert to KMP)
|
├── commons/ # Shared UI components (convert to KMP)
|
||||||
│ └── src/
|
│ └── src/
|
||||||
│ ├── commonMain/ # Shared composables, icons, state
|
│ ├── commonMain/ # Shared composables, icons, state
|
||||||
@@ -20,12 +27,12 @@ amethyst/
|
|||||||
│ └── jvmMain/ # Desktop-specific UI utilities
|
│ └── jvmMain/ # Desktop-specific UI utilities
|
||||||
├── desktopApp/ # Desktop JVM application (layouts, navigation)
|
├── desktopApp/ # Desktop JVM application (layouts, navigation)
|
||||||
├── amethyst/ # Android app (layouts, navigation)
|
├── amethyst/ # Android app (layouts, navigation)
|
||||||
└── ammolite/ # Support module
|
└── ammolite/ # Support module (unused)
|
||||||
```
|
```
|
||||||
|
|
||||||
**Sharing Philosophy:**
|
**Sharing Philosophy:**
|
||||||
- `quartz/` = Business logic, protocol, data (no UI)
|
- `quartz/` = Nostr business logic, protocol, data (no UI)
|
||||||
- `commons/` = Shared UI components, icons, composables, **ViewModels**
|
- `commons/` = Shared UI components, icons, composables, flows and ViewModels
|
||||||
- `amethyst/` & `desktopApp/` = Platform-native layouts and navigation
|
- `amethyst/` & `desktopApp/` = Platform-native layouts and navigation
|
||||||
|
|
||||||
## Tech Stack
|
## Tech Stack
|
||||||
@@ -241,6 +248,13 @@ actual fun openExternalUrl(url: String) {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Code Formatting
|
||||||
|
After completing any task that modifies Kotlin files, always run:
|
||||||
|
```
|
||||||
|
./gradlew spotlessApply
|
||||||
|
```
|
||||||
|
Do this before considering the task complete.
|
||||||
|
|
||||||
### Navigation Shell
|
### Navigation Shell
|
||||||
- **Desktop**: Sidebar + main content area
|
- **Desktop**: Sidebar + main content area
|
||||||
- **Android**: Bottom navigation
|
- **Android**: Bottom navigation
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
{
|
||||||
|
"hooks": {
|
||||||
|
"Stop": [
|
||||||
|
{
|
||||||
|
"matcher": "",
|
||||||
|
"hooks": [
|
||||||
|
{
|
||||||
|
"type": "command",
|
||||||
|
"command": "./gradlew spotlessApply",
|
||||||
|
"timeout": 120
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
+4
-1
@@ -63,6 +63,8 @@ import com.vitorpamplona.amethyst.ui.stringRes
|
|||||||
import com.vitorpamplona.amethyst.ui.theme.DividerThickness
|
import com.vitorpamplona.amethyst.ui.theme.DividerThickness
|
||||||
import com.vitorpamplona.amethyst.ui.theme.Size10dp
|
import com.vitorpamplona.amethyst.ui.theme.Size10dp
|
||||||
import com.vitorpamplona.amethyst.ui.theme.Size20dp
|
import com.vitorpamplona.amethyst.ui.theme.Size20dp
|
||||||
|
import com.vitorpamplona.amethyst.ui.theme.SpacedBy10dp
|
||||||
|
import com.vitorpamplona.amethyst.ui.theme.SpacedBy5dp
|
||||||
import com.vitorpamplona.amethyst.ui.theme.ThemeComparisonRow
|
import com.vitorpamplona.amethyst.ui.theme.ThemeComparisonRow
|
||||||
import java.util.Locale as JavaLocale
|
import java.util.Locale as JavaLocale
|
||||||
|
|
||||||
@@ -93,6 +95,7 @@ fun UserSettingsScreen(
|
|||||||
.padding(top = Size10dp, start = Size20dp, end = Size20dp)
|
.padding(top = Size10dp, start = Size20dp, end = Size20dp)
|
||||||
.verticalScroll(rememberScrollState()),
|
.verticalScroll(rememberScrollState()),
|
||||||
horizontalAlignment = Alignment.CenterHorizontally,
|
horizontalAlignment = Alignment.CenterHorizontally,
|
||||||
|
verticalArrangement = SpacedBy10dp,
|
||||||
) {
|
) {
|
||||||
DontTranslateFromSetting(accountViewModel)
|
DontTranslateFromSetting(accountViewModel)
|
||||||
TranslateToSetting(accountViewModel)
|
TranslateToSetting(accountViewModel)
|
||||||
@@ -219,7 +222,7 @@ fun LanguagePreferencesSetting(accountViewModel: AccountViewModel) {
|
|||||||
|
|
||||||
if (languagePreferences.isEmpty()) return
|
if (languagePreferences.isEmpty()) return
|
||||||
|
|
||||||
Column {
|
Column(verticalArrangement = SpacedBy5dp) {
|
||||||
SettingsRow(
|
SettingsRow(
|
||||||
name = R.string.language_preferences,
|
name = R.string.language_preferences,
|
||||||
description = R.string.language_preferences_description,
|
description = R.string.language_preferences_description,
|
||||||
|
|||||||
Reference in New Issue
Block a user