Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d0b94df7 authored by stefan-niedermann's avatar stefan-niedermann
Browse files

Merge remote-tracking branch 'origin/master' into synchronize-on-wifi-only

# Conflicts:
#	app/src/main/res/values/strings.xml
#	app/src/main/res/xml/preferences.xml
parents 257b3424 b4d260b7
Loading
Loading
Loading
Loading
+10 −4
Original line number Diff line number Diff line
@@ -5,14 +5,14 @@ import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.preference.PreferenceManager;
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatActivity;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;

import java.util.Calendar;

import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatActivity;
import it.niedermann.owncloud.notes.R;
import it.niedermann.owncloud.notes.android.fragment.BaseNoteFragment;
import it.niedermann.owncloud.notes.android.fragment.NoteEditFragment;
@@ -24,6 +24,8 @@ import it.niedermann.owncloud.notes.util.NoteUtil;

public class EditNoteActivity extends AppCompatActivity implements BaseNoteFragment.NoteFragmentListener {

    private static final String INTENT_GOOGLE_ASSISTANT = "com.google.android.gm.action.AUTO_SEND";
    private static final String MIMETYPE_TEXT_PLAIN = "text/plain";
    public static final String PARAM_NOTE_ID = "noteId";
    public static final String PARAM_CATEGORY = "category";

@@ -138,7 +140,11 @@ public class EditNoteActivity extends AppCompatActivity implements BaseNoteFragm
        }

        String content = "";
        if (Intent.ACTION_SEND.equals(intent.getAction()) && "text/plain".equals(intent.getType())) {
        if (
                MIMETYPE_TEXT_PLAIN.equals(intent.getType()) &&
                        (Intent.ACTION_SEND.equals(intent.getAction()) ||
                                INTENT_GOOGLE_ASSISTANT.equals(intent.getAction()))
                ) {
            content = intent.getStringExtra(Intent.EXTRA_TEXT);
        }

+13 −5
Original line number Diff line number Diff line
package it.niedermann.owncloud.notes.android.fragment;

import android.content.SharedPreferences;
import android.graphics.Typeface;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.preference.PreferenceManager;
import android.text.Editable;
import android.text.TextWatcher;
import android.util.Log;
@@ -138,7 +141,12 @@ public class NoteEditFragment extends BaseNoteFragment {
                        editContent.setText(charSequence, TextView.BufferType.SPANNABLE);
                    }
                });

        editContent.setCustomSelectionActionModeCallback(new StyleCallback(this.editContent));
        SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(getActivity().getApplicationContext());
        if(sp.getBoolean("font", false)) {
            editContent.setTypeface(Typeface.MONOSPACE);
        }
    }

    @Override
+21 −13
Original line number Diff line number Diff line
package it.niedermann.owncloud.notes.android.fragment;

import android.content.SharedPreferences;
import android.graphics.Typeface;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.text.method.LinkMovementMethod;
import android.util.Log;
import android.view.LayoutInflater;
@@ -95,6 +98,11 @@ public class NotePreviewFragment extends BaseNoteFragment {
                });
        noteContent.setText(content);
        noteContent.setMovementMethod(LinkMovementMethod.getInstance());

        SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(getActivity().getApplicationContext());
        if (sp.getBoolean("font", false)) {
            noteContent.setTypeface(Typeface.MONOSPACE);
        }
    }

    @Override
+5 −0
Original line number Diff line number Diff line
<vector android:height="24dp" android:tint="#757575"
    android:viewportHeight="24.0" android:viewportWidth="24.0"
    android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
    <path android:fillColor="#FF000000" android:pathData="M2.5,4v3h5v12h3L10.5,7h5L15.5,4h-13zM21.5,9h-9v3h3v7h3v-7h3L21.5,9z"/>
</vector>
+1 −1
Original line number Diff line number Diff line
@@ -4,7 +4,7 @@

    <color name="primary_dark">#286090</color>

    <color name="separator">#444</color>
    <color name="separator">#262626</color>

    <color name="bg_highlighted">#111</color>
    <color name="bg_normal">#222222</color>
Loading