Code Monkey home page Code Monkey logo

jotdraft's Introduction

๐Ÿ‘‹ Hi, I'm @kitakkun.

My Backgrounds ๐Ÿ“œ

  • coding since junior high school (over 9 years)
  • learning various programming languages (Java, PHP, Javascript, C#, Python, C, C++, Kotlin, ... and more)
  • mainly worked on web developments from junior high school to high school. (my high school still seems to use the website I created... not so good one)
  • created a video game like Tetris, and gave a presentation about it in high school.

And Now... ๐Ÿ‘€

I'm interested in

  • Image Processing ๐Ÿ–ผ
  • Deep Learning ๐Ÿง 
  • Video Game Development ๐ŸŽฎ
  • Software Development ๐Ÿ’ป
  • Mobile App Development ๐Ÿ“ฑ
  • and more...

More Information ๐Ÿ’ญ

  • Will be an Android Engineer next year! Loves Kotlin.
  • Infinity love towards Linux and macOS!!๐Ÿง๐ŸŽ
  • Not so good at speaking English, but I prefer English to Japanese when it comes to computers.
  • Please feel free to contact me. My Twitter DM is open to anyone. Also, my website has contact form.

Have a nice day! :)

My GitHub Stats

jotdraft's People

Contributors

kitakkun avatar

Stargazers

 avatar

Watchers

 avatar

jotdraft's Issues

Add Redo and Undo Features

This is nice to be able to revert changes. We should allow users to undo or redo changes.

Specification

We should save changes when user's behavior changes.
For example,

  • insert text -> delete text
  • delete text -> paste text
  • insert text -> move cursor
  • insert text -> idle for a moment

These actions indicate that user completed 1 step of editing.

Idle Moment Detection

We assume no text content changes while 2 seconds (may be changed later).

App crashes when saving a document with custom color spans.

Error log

FATAL EXCEPTION: main
Process: com.github.kitakkun.noteapp, PID: 25278
java.lang.NumberFormatException: For input string: "18446462598732840960"
	at java.lang.Long.parseLong(Long.java:736)
	at java.lang.Long.parseLong(Long.java:861)
	at com.github.kitakkun.noteapp.ui.page.editor.editmodel.serializer.OverrideStyleTypeAdapter.read(OverrideStyleTypeAdapter.kt:60)
	at com.github.kitakkun.noteapp.ui.page.editor.editmodel.serializer.OverrideStyleTypeAdapter.read(OverrideStyleTypeAdapter.kt:9)
	at com.google.gson.TypeAdapter$1.read(TypeAdapter.java:199)
	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:129)
	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:220)
	at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.read(TypeAdapterRuntimeTypeWrapper.java:41)
	at com.google.gson.internal.bind.ArrayTypeAdapter.read(ArrayTypeAdapter.java:72)
	at com.google.gson.Gson.fromJson(Gson.java:887)
	at com.google.gson.Gson.fromJson(Gson.java:852)
	at com.google.gson.Gson.fromJson(Gson.java:801)
	at com.google.gson.Gson.fromJson(Gson.java:773)
	at com.github.kitakkun.noteapp.data.DocumentConverter.toOverrideStyleAnchorList(DocumentConverter.kt:26)
	at com.github.kitakkun.noteapp.data.DocumentDao_Impl.getAll(DocumentDao_Impl.java:227)
	at com.github.kitakkun.noteapp.data.DocumentRepository$fetchDocuments$2.invokeSuspend(DocumentRepository.kt:53)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
	at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:42)
	at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95)
	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)
	Suppressed: kotlinx.coroutines.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@5c237f5, Dispatchers.Main.immediate]

App Crashes when Attempting to Select Non-Existent Characters at End of Text

Error log

FATAL EXCEPTION: main
Process: com.github.kitakkun.noteapp, PID: 19141
java.lang.IllegalArgumentException: lineIndex(3) is out of bounds [0, 3)
	at androidx.compose.ui.text.MultiParagraph.requireLineIndexInRange(MultiParagraph.kt:783)
	at androidx.compose.ui.text.MultiParagraph.getLineLeft(MultiParagraph.kt:659)
	at androidx.compose.ui.text.TextLayoutResult.getLineLeft(TextLayoutResult.kt:439)
	at androidx.compose.foundation.text.TextLayoutResultProxy.isPositionOnText-k-4lQ0M(TextLayoutResultProxy.kt:65)
	at androidx.compose.foundation.text.selection.TextFieldSelectionManager$touchSelectionObserver$1.onStart-k-4lQ0M(TextFieldSelectionManager.kt:181)
	at androidx.compose.foundation.text.LongPressTextDragObserverKt$detectDragGesturesAfterLongPressWithObserver$2.invoke-k-4lQ0M(LongPressTextDragObserver.kt:68)
	at androidx.compose.foundation.text.LongPressTextDragObserverKt$detectDragGesturesAfterLongPressWithObserver$2.invoke(LongPressTextDragObserver.kt:62)
	at androidx.compose.foundation.gestures.DragGestureDetectorKt$detectDragGesturesAfterLongPress$5.invokeSuspend(DragGestureDetector.kt:238)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTaskKt.resume(DispatchedTask.kt:178)
	at kotlinx.coroutines.DispatchedTaskKt.dispatch(DispatchedTask.kt:166)
	at kotlinx.coroutines.CancellableContinuationImpl.dispatchResume(CancellableContinuationImpl.kt:397)
	at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl(CancellableContinuationImpl.kt:431)
	at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl$default(CancellableContinuationImpl.kt:420)
	at kotlinx.coroutines.CancellableContinuationImpl.resumeWith(CancellableContinuationImpl.kt:328)
	at androidx.compose.ui.input.pointer.SuspendingPointerInputFilter$PointerEventHandlerCoroutine$withTimeout$job$1.invokeSuspend(SuspendingPointerInputFilter.kt:624)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
	at androidx.compose.ui.platform.AndroidUiDispatcher.performTrampolineDispatch(AndroidUiDispatcher.android.kt:81)
	at androidx.compose.ui.platform.AndroidUiDispatcher.access$performTrampolineDispatch(AndroidUiDispatcher.android.kt:41)
	at androidx.compose.ui.platform.AndroidUiDispatcher$dispatchCallback$1.run(AndroidUiDispatcher.android.kt:57)
	at android.os.Handler.handleCallback(Handler.java:942)
	at android.os.Handler.dispatchMessage(Handler.java:99)
	at android.os.Looper.loopOnce(Looper.java:201)
	at android.os.Looper.loop(Looper.java:288)
	at android.app.ActivityThread.main(ActivityThread.java:7918)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
	Suppressed: kotlinx.coroutines.DiagnosticCoroutineContextException: [androidx.compose.ui.platform.MotionDurationScaleImpl@5079581, androidx.compose.runtime.BroadcastFrameClock@68e2626, StandaloneCoroutine{Cancelling}@18a0267, AndroidUiDispatcher@7289814]

How to reproduce

  1. Specify base style to Title
  2. input some text
  3. insert linebreak
  4. change base style to the other
  5. input some text
  6. insert linebreak
  7. try to select the end of line(long press at the end of document)

Add Dynamic Color Support

Backgrounds

Dark theme or Light theme, it depends on users. For now, Black is Black, White is White... regardless of themes.

It would be great if dynamically changes color of Document.

Idea

Define a single color by two colors which correspond to dark and light themes. Default colors will be provided by "dynamic" color.

When adding a custom color, we should allow users to determine which type of color to configure, "static" or "dynamic".

Application crashes when saving a document with applied OverrideStyle (such as Bold)

Error log

FATAL EXCEPTION: main
Process: com.github.kitakkun.noteapp, PID: 18720
java.lang.RuntimeException: Unable to invoke no-args constructor for interface com.github.kitakkun.noteapp.ui.page.editor.editmodel.style.OverrideStyle. Register an InstanceCreator with Gson for this type may fix this problem.
	at com.google.gson.internal.ConstructorConstructor$14.construct(ConstructorConstructor.java:226)
	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:210)
	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:129)
	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:220)
	at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.read(TypeAdapterRuntimeTypeWrapper.java:41)
	at com.google.gson.internal.bind.ArrayTypeAdapter.read(ArrayTypeAdapter.java:72)
	at com.google.gson.Gson.fromJson(Gson.java:887)
	at com.google.gson.Gson.fromJson(Gson.java:852)
	at com.google.gson.Gson.fromJson(Gson.java:801)
	at com.google.gson.Gson.fromJson(Gson.java:773)
	at com.github.kitakkun.noteapp.data.DocumentConverter.toOverrideStyleAnchorList(DocumentConverter.kt:26)
	at com.github.kitakkun.noteapp.data.DocumentDao_Impl.getAll(DocumentDao_Impl.java:227)
	at com.github.kitakkun.noteapp.data.DocumentRepository$fetchDocuments$2.invokeSuspend(DocumentRepository.kt:53)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
	at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:42)
	at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95)
	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)
	Suppressed: kotlinx.coroutines.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@fd492ba, Dispatchers.Main.immediate]
Caused by: java.lang.UnsupportedOperationException: Interface can't be instantiated! Interface name: com.github.kitakkun.noteapp.ui.page.editor.editmodel.style.OverrideStyle
	at com.google.gson.internal.UnsafeAllocator.assertInstantiable(UnsafeAllocator.java:117)
	at com.google.gson.internal.UnsafeAllocator.access$000(UnsafeAllocator.java:31)
	at com.google.gson.internal.UnsafeAllocator$1.newInstance(UnsafeAllocator.java:49)
	at com.google.gson.internal.ConstructorConstructor$14.construct(ConstructorConstructor.java:223)
	... 20 more

How to Reproduce

  1. create a new document
  2. click on bold button to enable bold format
  3. input some characters
  4. save document(crash)

Document can't be opened anymore

Error Log

FATAL EXCEPTION: main
Process: com.github.kitakkun.noteapp, PID: 20225
java.lang.IndexOutOfBoundsException: setSpan (37 ... 38) ends beyond length 37
	at android.text.SpannableStringInternal.checkRange(SpannableStringInternal.java:493)
	at android.text.SpannableStringInternal.setSpan(SpannableStringInternal.java:199)
	at android.text.SpannableStringInternal.setSpan(SpannableStringInternal.java:186)
	at android.text.SpannableString.setSpan(SpannableString.java:60)
	at androidx.compose.ui.text.platform.AndroidAccessibilitySpannableString_androidKt.setSpanStyle(AndroidAccessibilitySpannableString.android.kt:122)
	at androidx.compose.ui.text.platform.AndroidAccessibilitySpannableString_androidKt.toAccessibilitySpannableString(AndroidAccessibilitySpannableString.android.kt:79)
	at androidx.compose.ui.platform.AndroidComposeViewAccessibilityDelegateCompat.setText(AndroidComposeViewAccessibilityDelegateCompat.android.kt:1268)
	at androidx.compose.ui.platform.AndroidComposeViewAccessibilityDelegateCompat.populateAccessibilityNodeInfoProperties(AndroidComposeViewAccessibilityDelegateCompat.android.kt:772)
	at androidx.compose.ui.platform.AndroidComposeViewAccessibilityDelegateCompat.createNodeInfo(AndroidComposeViewAccessibilityDelegateCompat.android.kt:518)
	at androidx.compose.ui.platform.AndroidComposeViewAccessibilityDelegateCompat.access$createNodeInfo(AndroidComposeViewAccessibilityDelegateCompat.android.kt:189)
	at androidx.compose.ui.platform.AndroidComposeViewAccessibilityDelegateCompat$MyNodeProvider.createAccessibilityNodeInfo(AndroidComposeViewAccessibilityDelegateCompat.android.kt:2867)
	at android.view.AccessibilityInteractionController.populateAccessibilityNodeInfoForView(AccessibilityInteractionController.java:427)
	at android.view.AccessibilityInteractionController.findAccessibilityNodeInfoByAccessibilityIdUiThread(AccessibilityInteractionController.java:363)
	at android.view.AccessibilityInteractionController.-$$Nest$mfindAccessibilityNodeInfoByAccessibilityIdUiThread(Unknown Source:0)
	at android.view.AccessibilityInteractionController$PrivateHandler.handleMessage(AccessibilityInteractionController.java:1647)
	at android.os.Handler.dispatchMessage(Handler.java:106)
	at android.os.Looper.loopOnce(Looper.java:201)
	at android.os.Looper.loop(Looper.java:288)
	at android.app.ActivityThread.main(ActivityThread.java:7918)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)

Debug print

fetchDocumentData: DocumentEntity(id=2789e5e7-cac3-4c83-9f03-ff4aa1ea2ba6, title=Untitled, content=ใ‚ใ‚ใ‚ใ‚ใ‚ใ‚ใ‚ใ‚ใ‚
ใ„ใ„ใ„ใ„ใ„ใ„ใ„ใ„
ใ†ใ†ใ†ใ†ใ†ใ†ใ†
ๆ—ฉใ็œ ใ‚ŠใŸใ„ใ€‚ใ€‚ใ€‚, baseStyleAnchors=[BaseStyleAnchor(line=4, style=Title), BaseStyleAnchor(line=3, style=Body), BaseStyleAnchor(line=2, style=Body), BaseStyleAnchor(line=1, style=Body), BaseStyleAnchor(line=0, style=Body)], overrideStyleAnchors=[OverrideStyleAnchor(start=0, end=10, style=Color(color=Color(1.0, 1.0, 1.0, 1.0, sRGB IEC61966-2.1))), OverrideStyleAnchor(start=10, end=11, style=Bold(enabled=true)), OverrideStyleAnchor(start=10, end=11, style=Color(color=Color(1.0, 1.0, 1.0, 1.0, sRGB IEC61966-2.1))), OverrideStyleAnchor(start=11, end=12, style=Bold(enabled=true)), OverrideStyleAnchor(start=11, end=12, style=Color(color=Color(1.0, 1.0, 1.0, 1.0, sRGB IEC61966-2.1))), OverrideStyleAnchor(start=12, end=13, style=Bold(enabled=true)), OverrideStyleAnchor(start=12, end=13, style=Color(color=Color(1.0, 1.0, 1.0, 1.0, sRGB IEC61966-2.1))), OverrideStyleAnchor(start=13, end=14, style=Bold(enabled=true)), OverrideStyleAnchor(start=13, end=14, style=Color(color=Color(1.0, 1.0, 1.0, 1.0, sRGB IEC61966-2.1))), OverrideStyleAnchor(start=14, end=15, style=Bold(enabled=true)), OverrideStyleAnchor(start=14, end=15, style=Color(color=Color(1.0, 1.0, 1.0, 1.0, sRGB IEC61966-2.1))), OverrideStyleAnchor(start=15, end=16, style=Bold(enabled=true)), OverrideStyleAnchor(start=15, end=16, style=Color(color=Color(1.0, 1.0, 1.0, 1.0, sRGB IEC61966-2.1))), OverrideStyleAnchor(start=16, end=17, style=Bold(enabled=true)), OverrideStyleAnchor(start=16, end=17, style=Color(color=Color(1.0, 1.0, 1.0, 1.0, sRGB IEC61966-2.1))), OverrideStyleAnchor(start=17, end=18, style=Bold(enabled=true)), OverrideStyleAnchor(start=17, end=18, style=Color(color=Color(1.0, 1.0, 1.0, 1.0, sRGB IEC61966-2.1))), OverrideStyleAnchor(start=18, end=19, style=Bold(enabled=true)), OverrideStyleAnchor(start=18, end=19, style=Italic(enabled=true)), OverrideStyleAnchor(start=18, end=19, style=Color(color=Color(1.0, 1.0, 1.0, 1.0, sRGB IEC61966-2.1))), OverrideStyleAnchor(start=19, end=20, style=Bold(enabled=true)), OverrideStyleAnchor(start=19, end=20, style=Italic(enabled=true)), OverrideStyleAnchor(start=19, end=20, style=Color(color=Color(1.0, 1.0, 1.0, 1.0, sRGB IEC61966-2.1))), OverrideStyleAnchor(start=20, end=21, style=Bold(enabled=true)), OverrideStyleAnchor(start=20, end=21, style=Italic(enabled=true)), OverrideStyleAnchor(start=20, end=21, style=Color(color=Color(1.0, 1.0, 1.0, 1.0, sRGB IEC61966-2.1))), OverrideStyleAnchor(start=21, end=22, style=Bold(enabled=true)), OverrideStyleAnchor(start=21, end=22, style=Italic(enabled=true)), OverrideStyleAnchor(start=21, end=22, style=Color(color=Color(1.0, 1.0, 1.0, 1.0, sRGB IEC61966-2.1))), OverrideStyleAnchor(start=22, end=23, style=Bold(enabled=true)), OverrideStyleAnchor(start=22, end=23, style=Italic(enabled=true)), OverrideStyleAnchor(start=22, end=23, style=Color(color=Color(1.0, 1.0, 1.0, 1.0, sRGB IEC61966-2.1))), OverrideStyleAnchor(start=23, end=24, style=Bold(enabled=true)), OverrideStyleAnchor(start=23, end=24, style=Italic(enabled=true)), OverrideStyleAnchor(start=23, end=24, style=Color(color=Color(1.0, 1.0, 1.0, 1.0, sRGB IEC61966-2.1))), OverrideStyleAnchor(start=24, end=25, style=Bold(enabled=true)), OverrideStyleAnchor(start=24, end=25, style=Italic(enabled=true)), OverrideStyleAnchor(start=24, end=25, style=Color(color=Color(1.0, 1.0, 1.0, 1.0, sRGB IEC61966-2.1))), OverrideStyleAnchor(start=25, end=26, style=Bold(enabled=true)), OverrideStyleAnchor(start=25, end=26, style=Italic(enabled=true)), OverrideStyleAnchor(start=25, end=26, style=Color(color=Color(1.0, 1.0, 1.0, 1.0, sRGB IEC61966-2.1))), OverrideStyleAnchor(start=26, end=27, style=Bold(enabled=true)), OverrideStyleAnchor(start=26, end=27, style=Italic(enabled=true)), OverrideStyleAnchor(start=26, end=27, style=Color(color=Color(1.0, 1.0, 1.0, 1.0, sRGB IEC61966-2.1))), OverrideStyleAnchor(start=27, end=28, style=Bold(enabled=true)), OverrideStyleAnchor(start=27, end=28, style=Italic(enabled=true)), OverrideStyleAnchor(start=27, end=28, style=Color(color=Color(1.0, 1.0, 1.0, 1.0, s

Add Auto-Save Feature Support

Overview

  • When auto-save configuration is enabled, editor will automatically save current state of document into a database.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.