mirror of
https://github.com/nextcloud/notes-android.git
synced 2024-11-25 22:36:17 +03:00
Remove ReactiveX wrapper
This commit is contained in:
parent
8b7a6780f5
commit
feba44e679
4 changed files with 11 additions and 31 deletions
|
@ -35,8 +35,6 @@ android {
|
|||
dependencies {
|
||||
implementation "com.github.nextcloud:Android-SingleSignOn:0.5.0-rc1"
|
||||
|
||||
implementation 'io.reactivex:rxandroid:1.2.1'
|
||||
implementation 'io.reactivex:rxjava:1.3.8'
|
||||
implementation 'com.yydcdut:markdown-processor:0.1.3'
|
||||
implementation 'com.yydcdut:rxmarkdown-wrapper:0.1.3'
|
||||
|
||||
|
|
|
@ -17,13 +17,12 @@ import android.view.View;
|
|||
import android.view.ViewGroup;
|
||||
import android.view.WindowManager;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.yydcdut.markdown.MarkdownEditText;
|
||||
import com.yydcdut.markdown.MarkdownProcessor;
|
||||
import com.yydcdut.markdown.syntax.edit.EditFactory;
|
||||
import com.yydcdut.rxmarkdown.RxMDEditText;
|
||||
import com.yydcdut.rxmarkdown.RxMarkdown;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
|
@ -34,7 +33,6 @@ import it.niedermann.owncloud.notes.model.CloudNote;
|
|||
import it.niedermann.owncloud.notes.util.ICallback;
|
||||
import it.niedermann.owncloud.notes.util.MarkDownUtil;
|
||||
import it.niedermann.owncloud.notes.util.StyleCallback;
|
||||
import rx.Subscriber;
|
||||
|
||||
public class NoteEditFragment extends BaseNoteFragment {
|
||||
|
||||
|
@ -43,7 +41,7 @@ public class NoteEditFragment extends BaseNoteFragment {
|
|||
private static final long DELAY = 2000; // Wait for this time after typing before saving
|
||||
private static final long DELAY_AFTER_SYNC = 5000; // Wait for this time after saving before checking for next save
|
||||
@BindView(R.id.editContent)
|
||||
RxMDEditText editContent;
|
||||
MarkdownEditText editContent;
|
||||
private Handler handler;
|
||||
private boolean saveActive, unsavedEdit;
|
||||
private final Runnable runAutoSave = new Runnable() {
|
||||
|
@ -138,26 +136,10 @@ public class NoteEditFragment extends BaseNoteFragment {
|
|||
editContent.setText(note.getContent());
|
||||
editContent.setEnabled(true);
|
||||
|
||||
RxMarkdown.live(editContent)
|
||||
.config(MarkDownUtil.getMarkDownConfiguration(editContent.getContext()).build())
|
||||
.factory(EditFactory.create())
|
||||
.intoObservable()
|
||||
.subscribe(new Subscriber<CharSequence>() {
|
||||
@Override
|
||||
public void onCompleted() {
|
||||
// Nothing to do here
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(CharSequence charSequence) {
|
||||
editContent.setText(charSequence, TextView.BufferType.SPANNABLE);
|
||||
}
|
||||
});
|
||||
MarkdownProcessor markdownProcessor = new MarkdownProcessor(getActivity());
|
||||
markdownProcessor.config(MarkDownUtil.getMarkDownConfiguration(editContent.getContext()).build());
|
||||
markdownProcessor.factory(EditFactory.create());
|
||||
markdownProcessor.live(editContent);
|
||||
|
||||
editContent.setCustomSelectionActionModeCallback(new StyleCallback(this.editContent));
|
||||
SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(getActivity().getApplicationContext());
|
||||
|
|
|
@ -4,8 +4,8 @@ import android.content.Context;
|
|||
|
||||
import androidx.core.content.res.ResourcesCompat;
|
||||
|
||||
import com.yydcdut.rxmarkdown.RxMDConfiguration;
|
||||
import com.yydcdut.rxmarkdown.RxMDConfiguration.Builder;
|
||||
import com.yydcdut.markdown.MarkdownConfiguration;
|
||||
import com.yydcdut.markdown.MarkdownConfiguration.Builder;
|
||||
|
||||
import it.niedermann.owncloud.notes.R;
|
||||
|
||||
|
@ -26,7 +26,7 @@ public class MarkDownUtil {
|
|||
}
|
||||
|
||||
public static Builder getMarkDownConfiguration(Context context, Boolean darkTheme) {
|
||||
return new RxMDConfiguration.Builder(context)
|
||||
return new MarkdownConfiguration.Builder(context)
|
||||
.setUnOrderListColor(ResourcesCompat.getColor(context.getResources(),
|
||||
darkTheme ? R.color.widget_fg_dark_theme : R.color.widget_fg_default, null))
|
||||
.setHeader2RelativeSize(1.35f)
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
android:orientation="vertical"
|
||||
tools:context="it.niedermann.owncloud.notes.android.activity.EditNoteActivity">
|
||||
|
||||
<com.yydcdut.rxmarkdown.RxMDEditText
|
||||
<com.yydcdut.markdown.MarkdownEditText
|
||||
android:id="@+id/editContent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
|
Loading…
Reference in a new issue