-
Notifications
You must be signed in to change notification settings - Fork 259
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Annotations support #843
Annotations support #843
Conversation
BTW, if anyone is interested, here are some code snippets I ran from AnnotationRange range = new AnnotationRange(null, null, "/ul[1]/li[1]", "/ul[1]/li[1]", 1, 5);
Annotation annotation = new Annotation(null, null, article.getId(), "Test annotation from app", null, null, null, null);
annotation.setRanges(Arrays.asList(range));
OperationsHelper.addAnnotation(this, article.getArticleId(), annotation);
fr.gaulupeau.apps.Poche.data.dao.entities.Annotation annotation = new ArrayList<>(article.getAnnotations()).get(1);
annotation.setText("Updated annotation from app");
OperationsHelper.updateAnnotation(this, article.getArticleId(), annotation);
OperationsHelper.deleteAnnotation(this, article.getArticleId(), new java.util.ArrayList<fr.gaulupeau.apps.Poche.data.dao.entities.Annotation>(article.getAnnotations()).get(1)) |
When having annotation support, maybe we can add a menu item to the navigation drawer, which is called "Annotated" or the like. It shall filter for annotated articles. With the tabs we can then see the unread, starred or achived annotated articles. |
It sure is possible. However, a harder part is some kind of UI for displaying and creating annotations - without it this code is useless. |
Rebased. Here's the old code just in case (github seems to save old commits, but I'm not bothered to check for how long). |
Add annotations entities. Extend updater logic to save annotations.
Add helper methods for changing annotations. Support uploading annotation changes.
Here's a very clunky AnnotatorJS-based UI. Since I'm not a web developer at all, it was an absolute pain to do. For that reason I didn't even try to implement the JS part myself, so I had to resort to some libraries. I considered using touch plugin, which only works with AnnotatorJS Instead I built AnnotatorJS's master. It is not mobile friendly, so I kludged it with Android's context menu action: you select text, press "Annotate" in the context menu, then annotator's "annotate" icon appears. That may be improved of course. Anyway, that last solution kinda works (UI wise; hopefully non-UI parts work ok). |
Fixed "Annotate" not doing anything on real devices. Removed that extra step: annotation editor appears directly after pressing "Annotate". AnnotatorJS is built from this branch ( |
Move estimated reading time and preview picture to header. Escape more content. Also slight refactoring.
Seeing the flurry of activity I presume this is the best it's gonna get (I'm certainly not improving it much more), so I'm marking annotations as an "experimental feature", disabling it by default and unlabeling PR's "work in progress" status. |
Oh, I keep forgetting to thank @The-Compiler for #884 - remote WebView debugging was immensely useful, thank you! |
I have installed this branch on my phone and i am going to test the feature. |
THANK YOU! This is a real deal breaker. Really hope it can be made better, but it works is certainly enough to keep (at least me) from switching. 😍 |
I tried this out the other day and noticed that annotations made in the web application does not show up in the Android app. I don't know if this is already reported elsewhere, but otherwise I can create a bug or feature request respectively. |
I am not sure, but my guess is that annotations are only synced to the app after a "full update" and not the default "fast update". It is a similar problem with the tags, e.g. #463 |
@Strubbl You are absolutely right. What's interesting is that any annotations made in the Android app syncs with the fast update, as the Android made annotations show up directly in the web application. |
Created a new issue with some explanation: #1048.
Changes made in the app are always synced ASAP. |
Currently implemented:
addAnnotation()
,updateAnnotation()
anddeleteAnnotation()
inOperationsHelper
.ReadArticleActivity
. Seewebview_htmlbase.html
andJsAnnotationController
for details.What's not done:
I'm not yet sure, but it seems that annotation changes on the server side do not mark articles as modified, so API clients never detect annotation changes. If that's correct, it may become an impediment akin to server-side deleted articles. Except this one doesn't have a workaround.
Everyone is welcome to step in to help with UI and JS stuff.
#115.