ソースを参照

添加drawlib.zip

peter 2 年 前
コミット
8498bfd15c

BIN
androidApp/src/androidMain/libs/shared-release.aar


BIN
desktopApp/libs/shared-desktop.jar


+ 51 - 0
desktopApp/src/jvmMain/kotlin/main.kt

@@ -1,5 +1,56 @@
 import androidx.compose.ui.window.Window
 import androidx.compose.ui.window.application
+//import com.cicoe.note.paint.core.PanelManager
+
+
+//fun initNote() {
+//    PanelObjects.init()
+////    File.unitTest()
+//    Thread.init()
+//    val page = Page()
+//    PanelManager.openedPanels.add(panelManager)
+////    page.manager = panelManager
+////    page.setNoteInfo(panelManager.getNoteInfo())
+//    val notePath = File.currentRootDirectory().absolutePath + "/../../note_test/a/1.ncc"
+//////    val pagePath = File.currentRootDirectory().absolutePath + "/../../note_test/1.p"
+////    val pagePath = File.currentRootDirectory().absolutePath + "/../note_test/s__res__/6.p"
+////    page.pagePath = pagePath
+////    page.load(pagePath)
+////    page.setLoaded(true)
+////    page.setLoadedInfo(true)
+////    page.getPageInfo().type = NoteInfo.PageType.paper
+////    page.getAllLayers().add(PageLayer())
+////    panelManager.getNote().pages.add(page)
+////    panelManager.newNoteLoad(panelManager, notePath, "")
+//    val sharedPreferences = SharedPreferences("note")
+//    val lastNote = sharedPreferences.getString("lastNote", "")
+//    dbg("lastNote: ${lastNote}")
+//    if (File(lastNote).exists()) {
+//        panelManager.noteFileManager.restoreNote(lastNote, "")
+//    } else {
+//        panelManager.noteFileManager.newNote(NoteInfo.NoteType.infinite, notePath, null, true)
+//            ?.let { note ->
+//                panelManager.setNote(note)
+//                panelManager.reRenderAll(true)
+//                sharedPreferences.putString("lastNote", note.notePath)
+//                sharedPreferences.save()
+//            }
+//    }
+//    panelManager.setOnActionChangedListener(object : OnActionChangedListener {
+//        override fun onActionChanged(manager: PanelManager, current: Int, pageIndex: Int) {
+//            dbg("onActionChanged: ${manager.getNotePath()}")
+//            manager.saveCurrentNote()
+//        }
+//
+//    })
+////    dbg("platform: ${com.newskyer.draw.Greeting().greet()}")
+//    dbg("INIT: ${panelManager.getCurrentPage()}, ${panelManager.getCurrentPages().size}, ${panelManager.getCurrentPageIndex()}")
+//    Utils.runInNewThread(200) {
+//        panelManager.reDraw()
+////        panelManager.getNote().notePath = "${File.currentRootDirectory().absolutePath}/../note_test/s.ncc"
+////        panelManager.saveCurrentNote()
+//    }
+//}
 
 fun main() = application {
     Window(onCloseRequest = ::exitApplication) {

BIN
drawlib.zip


+ 1 - 1
gradle.properties

@@ -22,4 +22,4 @@ android.minSdk=24
 #Versions
 kotlin.version=1.9.0
 agp.version=7.4.2
-compose.version=1.4.3
+compose.version=1.4.3

+ 2 - 0
settings.gradle.kts

@@ -9,6 +9,7 @@ pluginManagement {
         gradlePluginPortal()
         maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
         google()
+        mavenLocal()
     }
 
     plugins {
@@ -32,5 +33,6 @@ dependencyResolutionManagement {
         google()
         mavenCentral()
         maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
+        mavenLocal()
     }
 }

+ 31 - 25
shared/build.gradle.kts

@@ -1,6 +1,6 @@
 plugins {
     kotlin("multiplatform")
-    kotlin("native.cocoapods")
+//    kotlin("native.cocoapods")
     id("com.android.library")
     id("org.jetbrains.compose")
 }
@@ -10,22 +10,22 @@ kotlin {
 
     jvm("desktop")
 
-    iosX64()
-    iosArm64()
-    iosSimulatorArm64()
+//    iosX64()
+//    iosArm64()
+//    iosSimulatorArm64()
 
-    cocoapods {
-        version = "1.0.0"
-        summary = "Some description for the Shared Module"
-        homepage = "Link to the Shared Module homepage"
-        ios.deploymentTarget = "14.1"
-        podfile = project.file("../iosApp/Podfile")
-        framework {
-            baseName = "shared"
-            isStatic = true
-        }
-        extraSpecAttributes["resources"] = "['src/commonMain/resources/**', 'src/iosMain/resources/**']"
-    }
+//    cocoapods {
+//        version = "1.0.0"
+//        summary = "Some description for the Shared Module"
+//        homepage = "Link to the Shared Module homepage"
+//        ios.deploymentTarget = "14.1"
+//        podfile = project.file("../iosApp/Podfile")
+//        framework {
+//            baseName = "shared"
+//            isStatic = true
+//        }
+//        extraSpecAttributes["resources"] = "['src/commonMain/resources/**', 'src/iosMain/resources/**']"
+//    }
 
     sourceSets {
         val commonMain by getting {
@@ -35,6 +35,10 @@ kotlin {
                 implementation(compose.material)
                 @OptIn(org.jetbrains.compose.ExperimentalComposeLibrary::class)
                 implementation(compose.components.resources)
+                implementation(files("libs/shared-desktop.jar"))
+                implementation(files("libs/shared-release.aar"))
+                implementation("com.cicoe.note:shared:1.0")
+                //implementation(files("libs/drawlib-commonMain.jar"))
             }
         }
         val androidMain by getting {
@@ -42,20 +46,22 @@ kotlin {
                 api("androidx.activity:activity-compose:1.6.1")
                 api("androidx.appcompat:appcompat:1.6.1")
                 api("androidx.core:core-ktx:1.9.0")
+//                implementation(files("libs/shared-release.aar"))
             }
         }
-        val iosX64Main by getting
-        val iosArm64Main by getting
-        val iosSimulatorArm64Main by getting
-        val iosMain by creating {
-            dependsOn(commonMain)
-            iosX64Main.dependsOn(this)
-            iosArm64Main.dependsOn(this)
-            iosSimulatorArm64Main.dependsOn(this)
-        }
+//        val iosX64Main by getting
+//        val iosArm64Main by getting
+//        val iosSimulatorArm64Main by getting
+//        val iosMain by creating {
+//            dependsOn(commonMain)
+//            iosX64Main.dependsOn(this)
+//            iosArm64Main.dependsOn(this)
+//            iosSimulatorArm64Main.dependsOn(this)
+//        }
         val desktopMain by getting {
             dependencies {
                 implementation(compose.desktop.common)
+//                implementation(files("libs/shared-desktop.jar"))
             }
         }
     }

BIN
shared/libs/shared-desktop.jar


BIN
shared/libs/shared-release.aar


+ 4 - 0
shared/src/androidMain/kotlin/main.android.kt

@@ -1,5 +1,9 @@
 import androidx.compose.runtime.Composable
+import com.cicoe.note.paint.core.PanelManager
 
 actual fun getPlatformName(): String = "Android"
 
 @Composable fun MainView() = App()
+
+private fun aaa() {
+}

+ 10 - 2
shared/src/commonMain/kotlin/App.kt

@@ -12,9 +12,13 @@ import androidx.compose.runtime.remember
 import androidx.compose.runtime.setValue
 import androidx.compose.ui.Alignment
 import androidx.compose.ui.Modifier
+import com.cicoe.note.paint.core.PanelManager
 import org.jetbrains.compose.resources.ExperimentalResourceApi
 import org.jetbrains.compose.resources.painterResource
 
+fun aaa() {
+}
+
 @OptIn(ExperimentalResourceApi::class)
 @Composable
 fun App() {
@@ -23,7 +27,7 @@ fun App() {
         var showImage by remember { mutableStateOf(false) }
         Column(Modifier.fillMaxWidth(), horizontalAlignment = Alignment.CenterHorizontally) {
             Button(onClick = {
-                greetingText = "Hello, ${getPlatformName()}"
+                greetingText = "Hello, ${getPlatformName()} ${PanelManager.getAppRootDir()}"
                 showImage = !showImage
             }) {
                 Text(greetingText)
@@ -38,4 +42,8 @@ fun App() {
     }
 }
 
-expect fun getPlatformName(): String
+expect fun getPlatformName(): String
+
+fun ad() {
+    PanelManager.getAppRootDir()
+}

BIN
shared/src/commonMain/libs/shared-desktop.jar


BIN
shared/src/commonMain/libs/shared-release.aar


+ 2 - 0
shared/src/desktopMain/kotlin/main.desktop.kt

@@ -1,6 +1,8 @@
 import androidx.compose.desktop.ui.tooling.preview.Preview
 import androidx.compose.runtime.Composable
 
+//import com.cicoe.note.paint.core.PanelManager
+
 actual fun getPlatformName(): String = "Desktop"
 
 @Composable fun MainView() = App()