109 Commits

Author SHA1 Message Date
2c8bf8d5ae Make the MarkdownToolbar prettier 2020-08-15 12:29:37 +02:00
949a7e6662 Editor: Don't use the BottomAppBar
The BottomAppBar has a SafeArea widget inside which seems to give it an
extra top padding on my phone (OnePlus), I'm not sure why it thinks this
extra top padding is required.

Maybe this workaround will fail on other devices
2020-08-15 12:23:43 +02:00
c7a956c5bf Give MarkdownToolBar to TextEditingController
Instead of handling every single callback.
2020-08-13 00:12:25 +02:00
c048ead8a9 Log every feature and how we reach the purchase page
We now have a list of all the features that are implemented, and we can
use that to show a kind of feature list which can be used to -

1. Move away from app rental model
2. Showcase a feature list; see WorkingCopy
2020-08-10 16:05:26 +02:00
e6e0e08fe4 Mark more strings as translatable 2020-08-10 12:16:03 +02:00
9d55b449d3 Settings: Access it through the Provider
Make it a ChageNotifier and try to access it through the Provider
instead of like a global variable. This way, the state is better
managed and it'll be easier to split out Settings into smaller classes.
2020-08-09 01:29:22 +02:00
33c5aae23e MarkdownToolBar: First attempt at the toolbar
This can be enabled via 'Settings -> Experimental'. It's very rough
right now and a lot still needs to be done.

Related to #157
2020-08-06 13:40:45 +02:00
2ef2ccdf23 Editors: Allow the title to be edited even when YAML is disabled 2020-07-29 16:27:15 +02:00
15b978cacb Editors: Remove code duplication 2020-07-28 15:37:31 +02:00
0fe965a2d6 FocusMode: Show the elements when clicking on the top/bottom bar
Ideally clicking anywhere should show the UI, but that doesn't seem to
be working. With this at least clicking on the top/bottom bar will show
the UI.
2020-07-27 12:43:40 +02:00
b6e8f7a883 FocusMode: Do not accept inputs on the hidden elements
Setting the opacity to 0 doesn't meant we cannot interact with them.
2020-07-27 12:32:11 +02:00
606b3d8c24 Fork ChangeNotifier
The EditorStates are inheriting from State and using the ChangeNotifier
mixin. Both the ChangeNotifier and the State class have a dispose
function, which needs to be call.

Without this only the ChangeNotifier's dispose method was being called.
2020-07-27 10:17:17 +02:00
175bf85531 Save zenMode in settings
That way we don't need to toggle it each time.

Maybe it would be nice to have this exposed via the settings as well,
per editor. So I could enable it / disable it per editor.
2020-07-27 10:08:17 +02:00
3996a9163b Change Zen Mode text
Show 'Enable Zen Mode' or 'Disable Zen Mode' instead of just the toggle.
2020-07-27 09:49:24 +02:00
571c219711 Move EditorScaffold to its own file 2020-07-27 09:44:36 +02:00
e9cc050866 Implement a basic Zen Mode
This can be enabled in all the editors.
2020-07-27 09:39:31 +02:00
9d00fdac06 Use import_sorter
flutter pub run import_sorter:main --no-comments

The code feels much cleaner
2020-07-24 12:43:28 +02:00
5d7f616c6e const++ 2020-07-21 10:46:03 +02:00
c31edc3b57 MarkdownEditor: Change default mode to "Last Used"
Add an extra option of Last Used, along with Edit / View.
2020-07-06 17:14:07 +02:00
a43498ef6d Editor Heurisitics: Should work even if the items have spaces 2020-06-08 00:28:14 +02:00
6735f400fb Fix EditorHeuristics tests 2020-06-04 14:32:42 +02:00
9a39960c03 EditorHeuristics: Handle edge cases 2020-06-04 02:12:06 +02:00
c50e8ad999 Add more editor heuristics 2020-06-03 12:10:06 +02:00
47e8ac8b08 Auto add numbered lists when typing
Since we're using markdown it's kinda awesome that we can re-use the
same last number and markdown will arrange the numbers properly.
2020-06-01 23:26:49 +02:00
a5a7211788 Bullet Lists: Auto add bullets lists even when modifying in the middle 2020-06-01 21:14:59 +02:00
f4cc8e2b47 Refactor Auto bullet list in Editor
The earlier code base was a bit fragile, I prefer having this
unit-tested as the logic is a bit tricky, and I still don't support all
the use-cases.
2020-06-01 20:55:04 +02:00
e813edf397 Avoid using deprecated methods 2020-06-01 20:07:28 +02:00
9a726ba8db MarkdownEditor: Improve auto-bullet points
This patch scares me quite a bit. It's taken forever, and even now we
don't add a bullet point if we edit the middle of a list.
2020-06-01 17:55:42 +02:00
3808624655 MarkdownEditor: Auto add bullet points when editing
If the user presses Enter and were previously editing a bullet point,
then we should add a new bullet point with the same indentation.

This is a massive hack, and I don't like the way it is implemented. It
sucks that I cannot seem to access the keyboard events for the
TextField.

Fixes #140
2020-06-01 17:18:36 +02:00
327fddcae2 Journal/Markdown Editor: Change tick-mark back to cross when empty
When creating a new note, if some text is written and then removed, we
should update the icon accordingly. Ideally it would be awesome if this
could be done for any changes, but I think comparing the body of the
note after each change might be too expensive.
2020-05-31 09:56:28 +02:00
5d4c8ef178 Photo: Ignore photo_access_denied exception
Fixes APP-2Y
2020-05-31 02:12:14 +02:00
4208b05bb4 NoteEditor: Only enable 'Discard Changes' option if we have changes
Otherwise disable the button.
2020-05-19 00:02:07 +02:00
53f02db7f4 ChecklistEditor: Rename variable
More accurately describes its role
2020-05-18 00:49:32 +02:00
140954e7d1 ChecklistEditor: Remove trailing empty items 2020-05-18 00:42:15 +02:00
816cb0c3ed Reduce code duplication
Avoid code for determining the publicName of a folder.
2020-05-18 00:23:14 +02:00
ef57e263ba ProSettingsOverlay -> ProOverlay
Also move it to its own file
2020-05-14 16:10:09 +02:00
79ece901a8 Editors: Implement didUpdateWidget
The parent sometimes changes the noteModified parameter. It's strange
for me that the stateless widgets aren't always rebuilt if their parent
widget's properties change.
2020-05-14 12:49:52 +02:00
08a0c4c21a Make editing of Tags a pro feature 2020-05-13 01:38:52 +02:00
4375d0cf6d Add const 2020-05-13 01:21:40 +02:00
2847e3f60f Add basic tag support
This allows you to be modify the tags from the NoteEditor. Related to
 #114. We still need to add some way to filter the notes by tag. Also,
the current tag editor doesn't show the tags from the other notes.
2020-05-13 01:01:40 +02:00
e7cae7b07a NoteEditor: Convert top drop-down menu to bottom menu
It's easier to access from the bottom right as the finger is closer.
2020-05-12 23:18:41 +02:00
86264a15fe NoteEditor: Convert addIcon to attach icon
It's more accurate.
2020-05-12 23:01:25 +02:00
b2d0cf44ab Stop using deprecated TextStyle properties 2020-05-08 10:55:00 +02:00
533d837b05 ChecklistEditor: Make the Add Item more tappable
I would often tap on it and nothing would happen.
2020-05-08 10:15:36 +02:00
62b5761ec4 Editors: Do not use BottomAppBar in the scaffold property
The BottomAppBar when given in the Scaffold gets hidden when the
keyboard is visible. We had hacked around that by translating its
position, however that resulted in the cursor at the bottom being hidden
when we were typing a long note.

It is not just part of the body of the scaffold.

Also converted many functions into widgets.
2020-05-06 15:16:37 +02:00
f421b61fd4 Editor: Replace the scroll view
This one supresses the top glow animation, has a decent padding by
default, and occupies the entire space of its parent.
2020-05-06 14:20:56 +02:00
b26cfe8b81 Avoid mutating the state while building the Editor's bottom bar
getNote() mutates the state
2020-05-05 12:33:20 +02:00
b17c184900 Add very basic Image support [Android only]
This adds a '+' button to the NoteEditor which allows you to add an
image from either the Gallery or Take a photo. It then accordingly adds
updates markdown.

The file is added in the same directory as the note for now.

Related to #10
2020-05-05 12:02:36 +02:00
d0ab323356 Revert "Editor: Bring back 'Move to Folder' in the dropdown menu"
This reverts commit f129f2ac94e825b978f9c735ef2e110e2bfb6664.
2020-05-05 10:21:09 +02:00
f946fe487a Editor: Make the BottomAppBar stick above the keyboard
Workaround for https://github.com/flutter/flutter/issues/26499
2020-05-05 10:20:15 +02:00