fadelakin / drafts Goto Github PK
View Code? Open in Web Editor NEWthoughts...
License: MIT License
thoughts...
License: MIT License
When I have a draft saved that is shorter than the screen, such as these three lines of text:
List
First
When I tap that draft in the list to start editing it, the cursor is placed at the beginning of the text, like |List
. But almost always I want to add something at the end. I think the cursor should be placed at the end by default when the draft is opened, like First|
.
As a second, related request, when the cursor is not at the end, I think tapping below the last line of a draft should move the cursor to the end of the text. Currently, tapping below the last line does nothing. That is, when I touch here in this text-based mockup of my screen:
← Create New Draft Save ⋮
---
|List
First
⚞TOUCH⚟
---
[keyboard]
Currently, the cursor doesn’t move. But I want the cursor to move to the end, like this:
← Create New Draft Save ⋮
---
List
First|
---
[keyboard]
I’m not sure how Android’s UI system works, but if it’s like the web, it might be possible to achieve that by styling the multi-line text field to always take the full visible height of the screen, minus the height of the toolbar. Another way to say it is that the toolbar should have a defined height and the text field should fill the remainder of the screen.
When I open a draft by double-clicking it, then change my mind and hit Back without typing any text, I am still prompted with this alert:
Save draft?
[Discard] [Save]
This alert should only be shown if the text at the moment I hit Back is different from the text as it was when I first opened the draft.
For the Discard feature to work, you must already be saving the original text when I first open the draft. So this feature should only need one extra if
, plus a call to your discard function in the alternative branch. In pseudo-code:
if (textField.currentValue.equals(draftModel.originalValue)) {
discard();
} else {
// show prompt and save or discard as you currently do
}
When I click the (+)
action button to create a new draft, the toolbar still contains the three vertical dots ⋮
for the overflow menu:
← Create New Draft Save ⋮
Clicking it shows a menu with one item, Delete, the same as when editing a note:
← Create Ne[ Delete ]
But since I got here by creating a new note, Delete does nothing, instead of deleting the saved note like normal.
The solution I think makes the most sense is to rename the menu item to “Discard” in this case. I think “Discard” is better than “Delete” for this case because “Delete” implies the draft was already saved. When this menu item Discard is chosen, it would act the same as choosing Discard from the “Save draft?” prompt that appears if I click the Back button after entering text.
After I tap a draft in the list to edit it, the toolbar looks like this:
← Create New Draft Save ⋮
The title “Create New Draft” is only appropriate for the interface after touching the (+)
button to create a new draft. When editing an existing draft, the title should be something like “Edit Draft”:
← Edit Draft Save ⋮
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.