Merge branch 'develop' into feature/tinnyMCE

This commit is contained in:
houxg
2016-12-16 18:28:53 +08:00
7 changed files with 39 additions and 4 deletions

View File

@@ -1,9 +1,35 @@
# Leamonax # Leamonax
![Logo](https://raw.githubusercontent.com/houxg/Leamonax/develop/screenshot/logo.png) <img src='https://travis-ci.org/houxg/Leamonax.svg?branch=master'/>
This is a third party Android client for Leanote. Some of code(js editor) comes from [leanote-android](https://github.com/leanote/leanote-android). This is a third party Android client for Leanote.
**It's still in developing.** Be careful when you using it and make sure you have an backup. **It's still in developing.** Be careful when you using it and make sure you have an backup.
--- # Screenshot
![MainActivity](https://raw.githubusercontent.com/houxg/Leamonax/develop/screenshot/MainActivity.png) ![MainActivity](https://raw.githubusercontent.com/houxg/Leamonax/develop/screenshot/MainActivity.png)
![Navigation](https://raw.githubusercontent.com/houxg/Leamonax/develop/screenshot/Navigation.png)
![RichText](https://raw.githubusercontent.com/houxg/Leamonax/develop/screenshot/RichText.png)
![Markdown](https://raw.githubusercontent.com/houxg/Leamonax/develop/screenshot/Markdown.png)
# Install
[Git Release](https://github.com/houxg/Leamonax/releases/latest)
# Features
- [x] Sign in/up
- [x] Sync and view your notes/notebooks
- [x] RichText support
- [x] Markdown support
- [x] Custom host
- [x] Search by note's title
# TODO
- [ ] Chinese language support
- [ ] Quick note
- [ ] Integration of tinnyMCE
- [ ] Searching for full-text fields
- [ ] Import html file
# Thanks
## Contributors
[xingstarx](https://github.com/xingstarx)
##

View File

@@ -3,6 +3,7 @@ package org.houxg.leamonax.adapter;
import android.content.Context; import android.content.Context;
import android.support.v7.widget.RecyclerView; import android.support.v7.widget.RecyclerView;
import android.text.Html;
import android.text.SpannableStringBuilder; import android.text.SpannableStringBuilder;
import android.text.Spanned; import android.text.Spanned;
import android.text.TextUtils; import android.text.TextUtils;
@@ -76,7 +77,15 @@ public class NoteAdapter extends RecyclerView.Adapter<NoteAdapter.NoteHolder> {
} else { } else {
holder.titleTv.setText(getHighlightedText(note.getTitle())); holder.titleTv.setText(getHighlightedText(note.getTitle()));
} }
holder.contentTv.setText(note.getContent()); if (note.isMarkDown()) {
holder.contentTv.setText(note.getContent());
} else {
Spanned spannedContent = Html.fromHtml(note.getContent());
String contentStr = spannedContent.toString();
contentStr = contentStr.replaceAll("\\n\\n+", "\n");
holder.contentTv.setText(contentStr);
}
holder.notebookTv.setText(mNotebookId2TitleMaps.get(note.getNoteBookId())); holder.notebookTv.setText(mNotebookId2TitleMaps.get(note.getNoteBookId()));
long updateTime = note.getUpdatedTimeVal(); long updateTime = note.getUpdatedTimeVal();
Context context = holder.updateTimeTv.getContext(); Context context = holder.updateTimeTv.getContext();

BIN
screenshot/MainActivity.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 82 KiB

After

Width:  |  Height:  |  Size: 84 KiB

BIN
screenshot/Markdown.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

BIN
screenshot/Navigation.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

BIN
screenshot/RichText.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 KiB