Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
cb908b0
Settings Service
orual Sep 8, 2024
10a49cf
Bunch of state saving fixes and other stuff.
orual Sep 9, 2024
f74a3a2
Finally think i fixed the reply bug for good.
orual Sep 9, 2024
9e0812a
Big feed backend refactor the second.
orual Sep 10, 2024
59051a7
Ongoing session refresh and android state saving issues, hopefully fi…
orual Sep 13, 2024
3cd820c
Ok, session refresh definitely works now. Working on a refactor of th…
orual Sep 14, 2024
8b87178
Reverted a change around ScreenModel/ViewModel
orual Sep 14, 2024
71b29ef
Big UI refactoring ongoing.
orual Sep 15, 2024
5e19db1
Big UI refactoring ongoing.
orual Sep 16, 2024
1739d17
Big UI refactoring ongoing.
orual Sep 16, 2024
87fac14
Big UI refactoring ongoing.
orual Sep 17, 2024
d2e06a7
Big UI refactoring feels like it's nearing completion.
orual Sep 17, 2024
0326429
Some cleanup of unused code.
orual Sep 17, 2024
7ad0e94
Some cleanup of unused code.
orual Sep 17, 2024
a626863
Reverting to a previous commit with some changes, because there were …
orual Sep 17, 2024
50b7562
Merge branch 'orual-dev' into fixup
orual Sep 17, 2024
0f80616
Merge pull request #40 from morpho-app/fixup
orual Sep 17, 2024
9fddb22
nasty revert
orual Sep 17, 2024
0d708c7
gitignore
orual Sep 17, 2024
27f1741
gradle update and stuff
orual Sep 18, 2024
cd71704
FONTS! ACTUALLY GOOD FONTS!
orual Sep 18, 2024
fcf7b22
K, things are loading again, at least partially.
orual Sep 18, 2024
c84dce8
More things now loading.
orual Sep 18, 2024
d616e1c
Made a couple changes that seem to have improved the paging thing a b…
orual Sep 18, 2024
c576a10
Fixed busted token refresh
orual Sep 18, 2024
edb096e
Couple tiny fixes
orual Sep 18, 2024
24c1369
Some fixes, new thread bug. Seeing posts that are part of a thread du…
orual Sep 19, 2024
b15b9eb
Navigation drawer added.
orual Sep 21, 2024
d8a95e4
Added external extensibility and fallback deserialization to Preferen…
orual Sep 21, 2024
7d417ab
Bug https://github.com/Kotlin/kotlinx.serialization/issues/2288 is fi…
orual Sep 21, 2024
20536f1
Bug https://github.com/Kotlin/kotlinx.serialization/issues/2288 is fi…
orual Sep 21, 2024
0e33258
Working on the settings screen
orual Sep 22, 2024
081240d
Settings screen accessible and partially functional.
orual Sep 22, 2024
8247889
Few additional fixes
orual Sep 23, 2024
86f8ae6
making sure the log files aren't committed
orual Sep 23, 2024
a62dd2d
Have a better template implementation for stringy atproto unions/enum…
orual Sep 25, 2024
45c12b8
Have a better template implementation for stringy atproto unions/enum…
orual Sep 25, 2024
56a85fe
Have a better template implementation for stringy atproto unions/enum…
orual Sep 25, 2024
81eef90
Merge branch 'orual-dev' of https://github.com/morpho-app/Morpho into…
orual Sep 25, 2024
bcdbed4
Bunch of code for switching accounts and the like.
orual Sep 29, 2024
20fe819
Fixed a bunch of the issues with the thread collection and timeline d…
orual Oct 20, 2024
e042fab
Fixed a bunch of the issues with the thread collection and timeline d…
orual Oct 20, 2024
c2a8338
Further timeline filtering, presentation, etc. fixes.
orual Oct 21, 2024
adb8e45
Switching users works now!
orual Oct 21, 2024
4ba597d
Some library updates
orual Oct 22, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ Test Results*
Morpho/.kotlin
.kotlin
/.kotlin/
Butterfly
**.log
1 change: 1 addition & 0 deletions Butterfly
Submodule Butterfly added at 3d39e7
1 change: 1 addition & 0 deletions Morpho/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ captures
!*.xcodeproj/project.xcworkspace/
!*.xcworkspace/contents.xcworkspacedata
**/xcshareddata/WorkspaceSettings.xcsettings
**.log
1 change: 1 addition & 0 deletions Morpho/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ plugins {
alias(libs.plugins.kotlinParcelize).apply(false)
alias(libs.plugins.androidApplication).apply(false)
alias(libs.plugins.androidLibrary).apply(false)
id("com.codingfeline.buildkonfig") version "0.15.2" apply false

}

107 changes: 99 additions & 8 deletions Morpho/composeApp/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import com.codingfeline.buildkonfig.compiler.FieldSpec.Type.STRING
import org.jetbrains.compose.desktop.application.dsl.TargetFormat
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi

plugins {
alias(libs.plugins.kotlinMultiplatform)
Expand All @@ -9,13 +11,69 @@ plugins {
alias(libs.plugins.compose.compiler)

alias(libs.plugins.androidApplication)
id("com.codingfeline.buildkonfig")
id("kotlin-parcelize")
//id("kotlin-kapt")

//id("com.rickclephas.kmp.nativecoroutines") version "1.0.0-ALPHA-27"
}

val versionString = "1.0.0-alpha_1"
val packageString = "com.morpho.app"

buildkonfig {
packageName = packageString
// objectName = "YourAwesomeConfig"
// exposeObjectWithName = "YourAwesomePublicConfig"

defaultConfigs {
buildConfigField(STRING, "versionString", versionString)
buildConfigField(STRING, "packageName", packageString)
buildConfigField(STRING, "appName", "Morpho")
buildConfigField(STRING, "versionNumber", "0.1.0")
}
defaultConfigs("dev") {
buildConfigField(STRING, "versionString", "${versionString}-dev")
buildConfigField(STRING, "packageName", packageString)
buildConfigField(STRING, "appName", "Morpho")
buildConfigField(STRING, "versionNumber", "0.1.0")
}

targetConfigs {
create("android") {
buildConfigField(STRING, "versionString", "android-${versionString}")
}
create("desktop") {
buildConfigField(STRING, "versionString", "desktop-${versionString}")
}
create("ios") {
buildConfigField(STRING, "versionString", "ios-${versionString}")
}

}
targetConfigs("dev") {
create("android") {
buildConfigField(STRING, "versionString", "android-${versionString}-dev")
}
create("desktop") {
buildConfigField(STRING, "versionString", "desktop-${versionString}-dev")
}
create("ios") {
buildConfigField(STRING, "versionString", "ios-${versionString}-dev")
}

}
}

kotlin {
androidTarget {
@OptIn(ExperimentalKotlinGradlePluginApi::class)
compilerOptions {
freeCompilerArgs.addAll(
"-P",
"plugin:org.jetbrains.kotlin.parcelize:additionalAnnotation=com.morpho.app.CommonParcelize",
)
}
compilations.all {
kotlinOptions {
jvmTarget = "11"
Expand Down Expand Up @@ -74,11 +132,27 @@ kotlin {
implementation(libs.ktor.client.android)

implementation(libs.kotlin.jwt)

implementation(libs.androidx.paging.runtime)
implementation(libs.androidx.paging.compose)


//implementation(libs.logkmpanion)
}

commonMain.dependencies {
implementation("com.morpho:shared")

implementation("com.russhwolf:multiplatform-settings:1.2.0")
implementation("com.russhwolf:multiplatform-settings-serialization:1.2.0")
implementation("com.russhwolf:multiplatform-settings-coroutines:1.2.0")
implementation("com.russhwolf:multiplatform-settings-datastore:1.2.0")
implementation("com.russhwolf:multiplatform-settings-no-arg:1.2.0")
implementation("androidx.datastore:datastore-preferences-core:1.1.1")
implementation("androidx.datastore:datastore-core:1.1.1")

implementation(libs.paging.common)
implementation(libs.paging.compose.common)

implementation(compose.runtime)
implementation(compose.foundation)
Expand Down Expand Up @@ -116,9 +190,6 @@ kotlin {
implementation(libs.kotlinx.serialization.cbor)
implementation(libs.kotlinx.serialization.json)




implementation(kotlin("reflect"))

api(libs.logging)
Expand All @@ -133,6 +204,7 @@ kotlin {
implementation(libs.koin.core.coroutines)
implementation(libs.koin.annotations)
implementation(libs.koin.compose)
implementation("io.insert-koin:koin-logger-slf4j:3.5.3")


// Enables FileKit without Compose dependencies
Expand All @@ -147,6 +219,7 @@ kotlin {
implementation(libs.ktor.contentnegotiation)
implementation(libs.ktor.serialization.json)
implementation(libs.ktor.websockets)
implementation(libs.ktor.client.encoding)
implementation(libs.ktor.client.resources)
implementation(libs.ktor.client.auth)

Expand All @@ -155,6 +228,7 @@ kotlin {
implementation(libs.voyager.navigator)
// Screen Model
implementation(libs.voyager.screenmodel)
implementation(libs.voyager.lifecycle.kmp)
// BottomSheetNavigator
implementation(libs.voyager.bottom.sheet.navigator)
// TabNavigator
Expand All @@ -169,9 +243,12 @@ kotlin {
implementation(libs.slf4j.api)
//implementation(libs.slf4j.simple)

implementation(libs.toolargetool)
api(libs.parcelize)

}
nativeMain.dependencies {

implementation(libs.paging.runtime.uikit)
}
desktopMain.dependencies {
implementation(compose.desktop.currentOs)
Expand All @@ -182,19 +259,30 @@ kotlin {
implementation(libs.logback.classic)
implementation(libs.nativeparameterstoreaccess)
implementation(libs.kotlin.jwt)


//implementation(libs.logkmpanion)
}

commonTest.dependencies {
implementation(libs.kotlin.test)
@OptIn(org.jetbrains.compose.ExperimentalComposeLibrary::class)
implementation(compose.uiTest)
implementation(libs.paging.testing)


}
val desktopTest by getting {
dependencies {
implementation(compose.desktop.uiTestJUnit4)
implementation(compose.desktop.currentOs)
}
}
getByName("commonMain") {
dependencies {
implementation(libs.kotlinx.coroutines)
}
}
}
}

Expand All @@ -207,11 +295,11 @@ android {
sourceSets["main"].resources.srcDirs("src/commonMain/resources")

defaultConfig {
applicationId = "com.morpho.app"
applicationId = packageString
minSdk = libs.versions.android.minSdk.get().toInt()
targetSdk = libs.versions.android.targetSdk.get().toInt()
versionCode = 1
versionName = "1.0"
versionName = versionString
}
packaging {
resources {
Expand All @@ -231,7 +319,9 @@ android {
applicationIdSuffix = ".debug"
}
}

compileOptions {

sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
Expand Down Expand Up @@ -265,8 +355,9 @@ compose.desktop {
TargetFormat.AppImage,
TargetFormat.Pkg
)
packageName = "com.morpho.app"
packageVersion = "1.0.0"
packageName = packageString

packageVersion = versionString.split("-")[0]
}
}
}
Expand Down
7 changes: 0 additions & 7 deletions Morpho/composeApp/src/androidMain/kotlin/Platform.android.kt
Original file line number Diff line number Diff line change
@@ -1,7 +0,0 @@
import android.os.Build

class AndroidPlatform : Platform {
override val name: String = "Android ${Build.VERSION.SDK_INT}"
}

actual fun getPlatform(): Platform = AndroidPlatform()
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@ package com.morpho.app
import android.app.Application
import androidx.lifecycle.AndroidViewModel
import androidx.lifecycle.DefaultLifecycleObserver
import com.gu.toolargetool.TooLargeTool
import com.morpho.app.data.MorphoAgent
import com.morpho.app.data.PreferencesRepository
import com.morpho.app.di.appModule
import com.morpho.app.di.dataModule
import com.morpho.app.di.storageModule
import com.morpho.butterfly.AtIdentifier
import com.morpho.butterfly.Butterfly

import com.morpho.butterfly.auth.SessionRepository
import com.morpho.butterfly.auth.UserRepository
import org.koin.android.annotation.KoinViewModel
Expand All @@ -27,29 +26,24 @@ class AndroidMainViewModel(app: Application): AndroidViewModel(app), DefaultLife
val sessionRepository = app.getKoin().get<SessionRepository>()
val userRepository = app.getKoin().get<UserRepository>()

val api = app.getKoin().get<Butterfly>()
val agent = app.getKoin().get<MorphoAgent>()
}

class MorphoApplication : Application() {
override fun onCreate() {

TooLargeTool.startLogging(this);

val koin = startKoin {
androidContext(this@MorphoApplication)
androidLogger()
modules(androidModule, appModule, storageModule, dataModule)
modules(androidModule, appModule)//, storageModule, dataModule)
}.koin
val sessionRepository = koin.get<SessionRepository> { parametersOf(cacheDir.path.toString()) }
val userRepository = koin.get<UserRepository> { parametersOf(cacheDir.path.toString()) }
val prefs = koin.get<PreferencesRepository> { parametersOf(cacheDir.path.toString()) }
val id: AtIdentifier? = if(sessionRepository.auth?.did != null) {
sessionRepository.auth?.did
} else if (sessionRepository.auth?.handle != null) {
sessionRepository.auth?.handle
} else {
userRepository.firstUser()?.id
}
val api = koin.get<Butterfly> { parametersOf(id) }

val storageDir = getPlatformStorageDir(filesDir.path.toString())
koin.get<SessionRepository> { parametersOf(storageDir) }
koin.get<UserRepository> { parametersOf(storageDir) }
koin.get<PreferencesRepository> { parametersOf(storageDir) }
koin.get<MorphoAgent>()
super.onCreate()
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
@file:Suppress("EXPECT_ACTUAL_CLASSIFIERS_ARE_IN_BETA_WARNING")
package com.morpho.app

import android.os.Build
import android.os.Parcel
import android.os.Parcelable
import kotlinx.datetime.LocalDateTime
import kotlinx.parcelize.Parceler
import kotlinx.parcelize.Parcelize
import kotlinx.parcelize.RawValue
import kotlinx.parcelize.TypeParceler
import java.util.Locale

actual typealias CommonParcelize = Parcelize
actual typealias CommonParcelable = Parcelable

actual typealias CommonRawValue = RawValue
actual typealias CommonParceler<T> = Parceler<T>
actual typealias CommonTypeParceler<T,P> = TypeParceler<T, P>
actual object LocalDateTimeParceler : Parceler<LocalDateTime> {
override fun create(parcel: Parcel): LocalDateTime {
val date = parcel.readString()
return date?.let { LocalDateTime.parse(it) }
?: LocalDateTime(0, 0, 0, 0, 0)
}

override fun LocalDateTime.write(parcel: Parcel, flags: Int) {
parcel.writeString(this.toString())
}
}

class AndroidPlatform : Platform {
override val name: String = "Android ${Build.VERSION.SDK_INT}"
}

actual fun getPlatform(): Platform = AndroidPlatform()



actual val myLang:String?
get() = Locale.getDefault().language

actual val myCountry:String?
get() = Locale.getDefault().country

actual fun getPlatformStorageDir(baseDir: String): String {
return baseDir
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package com.morpho.app.com.morpho.app

import androidx.compose.foundation.layout.Column
import androidx.compose.runtime.Composable
import androidx.compose.ui.tooling.preview.Preview
import com.morpho.app.ui.post.PlaceholderSkylineItem
import com.morpho.app.ui.post.PostFragmentRole

@Preview
@Composable
fun PreviewPlaceholderSkylineItem() {
//MorphoTheme {
Column {
Column {
PlaceholderSkylineItem()
PlaceholderSkylineItem(role = PostFragmentRole.PrimaryThreadRoot)
PlaceholderSkylineItem(role = PostFragmentRole.ThreadBranchStart)
PlaceholderSkylineItem(role = PostFragmentRole.ThreadBranchMiddle)
PlaceholderSkylineItem(role = PostFragmentRole.ThreadBranchEnd)
PlaceholderSkylineItem(role = PostFragmentRole.ThreadRootUnfocused)
PlaceholderSkylineItem(role = PostFragmentRole.ThreadEnd)
PlaceholderSkylineItem(elevate = true)
}
}
//}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,5 @@ import androidx.compose.runtime.Composable

@Composable
actual fun BackHandler(content: () -> Unit) {
BackHandler {
content()
}

}
Loading