Fork Aux to make Torch
This commit is contained in:
@@ -1,3 +0,0 @@
|
||||
package ac.cord.auxiliary.compose
|
||||
|
||||
actual class PlatformContext
|
||||
@@ -1,4 +1,4 @@
|
||||
package ac.cord.auxiliary.compose
|
||||
package at.torch.compose
|
||||
|
||||
import platform.Foundation.NSBundle
|
||||
|
||||
@@ -1,15 +1,19 @@
|
||||
package ac.cord.auxiliary.compose
|
||||
package at.torch.compose
|
||||
|
||||
import androidx.compose.ui.window.ComposeUIViewController
|
||||
import androidx.navigation.compose.rememberNavController
|
||||
import fr.acinq.phoenix.PhoenixGlobal
|
||||
|
||||
fun MainViewController() = ComposeUIViewController {
|
||||
val navController = rememberNavController()
|
||||
|
||||
AuxApp(
|
||||
TorchApp(
|
||||
navController = navController,
|
||||
auxGlobal = AuxGlobal(
|
||||
torchGlobal = TorchGlobal(
|
||||
platformContext = PlatformContext()
|
||||
),
|
||||
phoenixGlobal = PhoenixGlobal(
|
||||
ctx = fr.acinq.phoenix.utils.PlatformContext()
|
||||
)
|
||||
)
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package ac.cord.auxiliary.compose
|
||||
package at.torch.compose
|
||||
|
||||
import platform.UIKit.UIDevice
|
||||
import kotlin.native.Platform
|
||||
|
||||
class IOSPlatform: Platform {
|
||||
override val name: String = UIDevice.currentDevice.systemName() + " " + UIDevice.currentDevice.systemVersion
|
||||
@@ -0,0 +1,3 @@
|
||||
package at.torch.compose
|
||||
|
||||
actual class PlatformContext
|
||||
@@ -1,18 +1,18 @@
|
||||
package ac.cord.auxiliary.compose.database.builder
|
||||
package at.torch.compose.database.builder
|
||||
|
||||
import ac.cord.auxiliary.compose.PlatformContext
|
||||
import ac.auxiliary.compose.database.AuxDatabase
|
||||
import androidx.room.Room
|
||||
import androidx.room.RoomDatabase
|
||||
import androidx.room3.Room
|
||||
import androidx.room3.RoomDatabase
|
||||
import at.torch.compose.PlatformContext
|
||||
import at.torch.compose.database.TorchDatabase
|
||||
import kotlinx.cinterop.ExperimentalForeignApi
|
||||
import platform.Foundation.NSDocumentDirectory
|
||||
import platform.Foundation.NSFileManager
|
||||
import platform.Foundation.NSUserDomainMask
|
||||
|
||||
actual object PlatformDatabaseBuilder {
|
||||
actual fun getDatabaseBuilder(platformContext: PlatformContext): RoomDatabase.Builder<AuxDatabase> {
|
||||
actual fun getDatabaseBuilder(platformContext: PlatformContext): RoomDatabase.Builder<TorchDatabase> {
|
||||
val dbFilePath = documentDirectory() + "/aux.db"
|
||||
return Room.databaseBuilder<AuxDatabase>(
|
||||
return Room.databaseBuilder<TorchDatabase>(
|
||||
name = dbFilePath,
|
||||
)
|
||||
}
|
||||
@@ -29,7 +29,7 @@ actual object PlatformDatabaseBuilder {
|
||||
return requireNotNull(documentDirectory?.path)
|
||||
}
|
||||
|
||||
actual fun getInMemoryDatabaseBuilder(platform: PlatformContext): RoomDatabase.Builder<AuxDatabase> {
|
||||
actual fun getInMemoryDatabaseBuilder(platform: PlatformContext): RoomDatabase.Builder<TorchDatabase> {
|
||||
return Room.inMemoryDatabaseBuilder()
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package ac.cord.auxiliary.compose.extensions
|
||||
package at.torch.compose.extensions
|
||||
|
||||
import co.touchlab.kermit.Logger
|
||||
import fr.acinq.bitcoin.Chain
|
||||
@@ -1,4 +1,4 @@
|
||||
package ac.cord.auxiliary.compose.ui.theme
|
||||
package at.torch.compose.ui.theme
|
||||
|
||||
import androidx.compose.material3.ColorScheme
|
||||
import androidx.compose.runtime.Composable
|
||||
@@ -1,6 +1,6 @@
|
||||
package ac.cord.auxiliary.compose.ui.view.model
|
||||
package at.torch.compose.ui.view.model
|
||||
|
||||
import ac.cord.auxiliary.compose.AppVersion
|
||||
import at.torch.compose.AppVersion
|
||||
import co.touchlab.kermit.Logger
|
||||
import fr.acinq.bitcoin.Chain
|
||||
import fr.acinq.bitcoin.MnemonicCode
|
||||
Reference in New Issue
Block a user