-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0d29546
commit f464352
Showing
6 changed files
with
87 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
app/src/main/java/org/kore/kolabnotes/android/fragment/KolabNotesRichEditor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package org.kore.kolabnotes.android.fragment; | ||
|
||
import android.content.Context; | ||
import android.net.Uri; | ||
import android.text.TextUtils; | ||
import android.util.AttributeSet; | ||
import android.webkit.WebView; | ||
import android.webkit.WebViewClient; | ||
|
||
import jp.wasabeef.richeditor.RichEditor; | ||
|
||
/** | ||
* This class is just here to fix issue 22 and because it looks like wasabeef is not activly developing the richeditor any more. | ||
* Have a look at these issues/pull requests: https://github.com/wasabeef/richeditor-android/pull/123/commits/c225299d443af660582877d232a27bcee14c2f70 | ||
* https://github.com/wasabeef/richeditor-android/issues/155 | ||
* https://github.com/wasabeef/richeditor-android/pull/145/commits/a71100298878f18bbe06cf1b2aac07bcadf838db | ||
* | ||
* @deprecated delete class and use a fixed version of wasabeef richeditor (if he will be active any day in the future again) | ||
*/ | ||
public class KolabNotesRichEditor extends RichEditor{ | ||
|
||
|
||
public KolabNotesRichEditor(Context context) { | ||
super(context); | ||
} | ||
|
||
public KolabNotesRichEditor(Context context, AttributeSet attrs) { | ||
super(context, attrs); | ||
} | ||
|
||
public KolabNotesRichEditor(Context context, AttributeSet attrs, int defStyleAttr) { | ||
super(context, attrs, defStyleAttr); | ||
} | ||
|
||
@Override | ||
protected EditorWebViewClient createWebviewClient() { | ||
return new KolabNotesEditorWebViewClient(); | ||
} | ||
|
||
protected class KolabNotesEditorWebViewClient extends RichEditor.EditorWebViewClient{ | ||
@Override | ||
public boolean shouldOverrideUrlLoading(WebView view, String url) { | ||
String decode = Uri.decode(url); | ||
|
||
//really really dirty hack to fix issue 174 | ||
decode = decode.replaceAll("\\+","+"); | ||
|
||
return super.shouldOverrideUrlLoading(view, decode); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters