Loading app/src/main/java/it/niedermann/owncloud/notes/android/activity/EditNoteActivity.java +10 −4 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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"; Loading Loading @@ -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); } Loading app/src/main/java/it/niedermann/owncloud/notes/android/fragment/NoteEditFragment.java +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; Loading Loading @@ -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 Loading app/src/main/java/it/niedermann/owncloud/notes/android/fragment/NotePreviewFragment.java +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; Loading Loading @@ -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 Loading app/src/main/res/drawable/ic_text_fields_black_24dp.xml 0 → 100644 +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> app/src/main/res/values-night/colors.xml +1 −1 Original line number Diff line number Diff line Loading @@ -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 Loading
app/src/main/java/it/niedermann/owncloud/notes/android/activity/EditNoteActivity.java +10 −4 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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"; Loading Loading @@ -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); } Loading
app/src/main/java/it/niedermann/owncloud/notes/android/fragment/NoteEditFragment.java +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; Loading Loading @@ -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 Loading
app/src/main/java/it/niedermann/owncloud/notes/android/fragment/NotePreviewFragment.java +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; Loading Loading @@ -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 Loading
app/src/main/res/drawable/ic_text_fields_black_24dp.xml 0 → 100644 +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>
app/src/main/res/values-night/colors.xml +1 −1 Original line number Diff line number Diff line Loading @@ -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