diff --git a/app/src/main/java/net/gsantner/markor/activity/DocumentShareIntoFragment.java b/app/src/main/java/net/gsantner/markor/activity/DocumentShareIntoFragment.java index 3578858715..22d07ea713 100644 --- a/app/src/main/java/net/gsantner/markor/activity/DocumentShareIntoFragment.java +++ b/app/src/main/java/net/gsantner/markor/activity/DocumentShareIntoFragment.java @@ -173,7 +173,7 @@ protected void afterOnCreate(Bundle savedInstances, Context context) { asLinkPref.setVisible(!findLinksAndPaths(_editor.getText()).isEmpty()); asLinkPref.setChecked(true); _editor.addTextChangedListener(GsTextWatcherAdapter.on((ctext, arg2, arg3, arg4) -> - asLinkPref.setVisible(!findLinksAndPaths(ctext).isEmpty()))); + asLinkPref.setVisible(!findLinksAndPaths(ctext).isEmpty()))); } } } @@ -212,8 +212,8 @@ private void appendToExistingDocumentAndClose(final File file, final boolean sho * * @param text Text to parse * @return List of pairs. - * The first element of the pair is the start and end index of the link/path. - * Second element is true if it is a path, false if it is a link. + * The first element of the pair is the start and end index of the link/path. + * Second element is true if it is a path, false if it is a link. */ public static List> findLinksAndPaths(final CharSequence text) { final List> links = new ArrayList<>(); diff --git a/app/src/main/java/net/gsantner/markor/format/ActionButtonBase.java b/app/src/main/java/net/gsantner/markor/format/ActionButtonBase.java index 4331ae1d58..92489173ee 100644 --- a/app/src/main/java/net/gsantner/markor/format/ActionButtonBase.java +++ b/app/src/main/java/net/gsantner/markor/format/ActionButtonBase.java @@ -586,8 +586,8 @@ protected void runSurroundAction(final String open, final String close, final bo final int f = TextViewUtils.getFirstNonWhitespace(selection); final int l = TextViewUtils.getLastNonWhitespace(selection) + 1; replace = selection.subSequence(0, f) + open + - selection.subSequence(f, l) + close + - selection.subSequence(l, sl); + selection.subSequence(f, l) + close + + selection.subSequence(l, sl); } else { replace = open + selection + close; } diff --git a/app/src/main/java/net/gsantner/markor/format/markdown/MarkdownActionButtons.java b/app/src/main/java/net/gsantner/markor/format/markdown/MarkdownActionButtons.java index 20c94ee39f..4a225e9bfe 100644 --- a/app/src/main/java/net/gsantner/markor/format/markdown/MarkdownActionButtons.java +++ b/app/src/main/java/net/gsantner/markor/format/markdown/MarkdownActionButtons.java @@ -164,7 +164,7 @@ public boolean onActionClick(final @StringRes int action) { /** * Used to surround selected text with a given delimiter (and remove it if present) - * + *

* Not super intelligent about how patterns can be combined. * Current regexes just look for the litera delimiters. * diff --git a/app/src/main/java/net/gsantner/markor/frontend/AttachLinkOrFileDialog.java b/app/src/main/java/net/gsantner/markor/frontend/AttachLinkOrFileDialog.java index b3f440a635..100cff2a55 100644 --- a/app/src/main/java/net/gsantner/markor/frontend/AttachLinkOrFileDialog.java +++ b/app/src/main/java/net/gsantner/markor/frontend/AttachLinkOrFileDialog.java @@ -12,7 +12,6 @@ import android.app.Activity; import android.content.Context; import android.content.DialogInterface; -import android.os.Build; import android.text.Editable; import android.view.View; import android.widget.Button; @@ -27,7 +26,6 @@ import net.gsantner.markor.R; import net.gsantner.markor.format.FormatRegistry; import net.gsantner.markor.format.markdown.MarkdownSyntaxHighlighter; -import net.gsantner.markor.format.todotxt.TodoTxtTask; import net.gsantner.markor.frontend.filebrowser.MarkorFileBrowserFactory; import net.gsantner.markor.frontend.filesearch.FileSearchDialog; import net.gsantner.markor.frontend.filesearch.FileSearchEngine; diff --git a/app/src/main/java/net/gsantner/markor/frontend/MarkorDialogFactory.java b/app/src/main/java/net/gsantner/markor/frontend/MarkorDialogFactory.java index acca7ceafa..dfb45ce609 100644 --- a/app/src/main/java/net/gsantner/markor/frontend/MarkorDialogFactory.java +++ b/app/src/main/java/net/gsantner/markor/frontend/MarkorDialogFactory.java @@ -514,7 +514,7 @@ public static void showColorSelectionModeDialog(Activity activity, GsCallback.a1 /** * Shows all checkboxes in the file in a muti select dialog. * The multi select can be used to check or uncheck them. - * + *

* Long pressing a line will jump to the line in the file. */ public static void showDocumentChecklistDialog( @@ -559,12 +559,12 @@ public static void showDocumentChecklistDialog( dopt.positionCallback = (result) -> { // Result has the indices of the checker lines which are selected - for (final int i: GsCollectionUtils.setDiff(checked, result)) { + for (final int i : GsCollectionUtils.setDiff(checked, result)) { final int cs = indices.get(i); chunked.replace(cs, cs + 1, uncheck); } - for (final int i: GsCollectionUtils.setDiff(result, checked)) { + for (final int i : GsCollectionUtils.setDiff(result, checked)) { final int cs = indices.get(i); chunked.replace(cs, cs + 1, check); } @@ -628,12 +628,12 @@ public static void showInsertItemsDialog( dopt.positionCallback = (result) -> { // Result has the indices of the checker lines which are selected - for (final int i: GsCollectionUtils.setDiff(checked, result)) { + for (final int i : GsCollectionUtils.setDiff(checked, result)) { final int cs = indices.get(i); chunked.replace(cs, cs + 1, uncheck); } - for (final int i: GsCollectionUtils.setDiff(result, checked)) { + for (final int i : GsCollectionUtils.setDiff(result, checked)) { final int cs = indices.get(i); chunked.replace(cs, cs + 1, check); } diff --git a/app/src/main/java/net/gsantner/markor/frontend/filesearch/FileSearchDialog.java b/app/src/main/java/net/gsantner/markor/frontend/filesearch/FileSearchDialog.java index 6b126e5f0e..c2b569db0f 100644 --- a/app/src/main/java/net/gsantner/markor/frontend/filesearch/FileSearchDialog.java +++ b/app/src/main/java/net/gsantner/markor/frontend/filesearch/FileSearchDialog.java @@ -22,7 +22,6 @@ import net.gsantner.markor.ApplicationObject; import net.gsantner.markor.R; import net.gsantner.markor.model.AppSettings; -import net.gsantner.opoc.format.GsTextUtils; import net.gsantner.opoc.util.GsContextUtils; import net.gsantner.opoc.wrapper.GsCallback; diff --git a/app/src/main/java/net/gsantner/markor/frontend/filesearch/FileSearchResultSelectorDialog.java b/app/src/main/java/net/gsantner/markor/frontend/filesearch/FileSearchResultSelectorDialog.java index ec95e78db6..5b02933aec 100644 --- a/app/src/main/java/net/gsantner/markor/frontend/filesearch/FileSearchResultSelectorDialog.java +++ b/app/src/main/java/net/gsantner/markor/frontend/filesearch/FileSearchResultSelectorDialog.java @@ -2,7 +2,6 @@ import android.annotation.SuppressLint; import android.app.Activity; -import android.app.Dialog; import android.content.Context; import android.database.DataSetObserver; import android.text.Editable; @@ -17,19 +16,16 @@ import android.widget.LinearLayout; import android.widget.TextView; -import androidx.annotation.Nullable; import androidx.appcompat.app.AlertDialog; import androidx.appcompat.widget.AppCompatEditText; import androidx.core.content.ContextCompat; import net.gsantner.markor.R; -import net.gsantner.markor.frontend.MarkorDialogFactory; import net.gsantner.markor.frontend.filesearch.FileSearchEngine.FitFile; import net.gsantner.opoc.util.GsContextUtils; import net.gsantner.opoc.wrapper.GsCallback; import net.gsantner.opoc.wrapper.GsTextWatcherAdapter; -import java.io.File; import java.util.ArrayList; import java.util.Collections; import java.util.List; @@ -38,12 +34,12 @@ public class FileSearchResultSelectorDialog { /** * Show a file system selector dialog * - * @param activity Activity to use - * @param searchResults Search results to filter - * @param callback Callback to call when a item is selected - * callback.first: Path to file (relative) - * callback.second: Line number (null if not applicable) - * callback.third: True if the dialog was dismissed by long clicking on a file + * @param activity Activity to use + * @param searchResults Search results to filter + * @param callback Callback to call when a item is selected + * callback.first: Path to file (relative) + * callback.second: Line number (null if not applicable) + * callback.third: True if the dialog was dismissed by long clicking on a file */ public static void showDialog( final Activity activity, diff --git a/app/src/main/java/net/gsantner/opoc/format/GsTextUtils.java b/app/src/main/java/net/gsantner/opoc/format/GsTextUtils.java index bb6b7b6e76..4ad3dd3c2f 100644 --- a/app/src/main/java/net/gsantner/opoc/format/GsTextUtils.java +++ b/app/src/main/java/net/gsantner/opoc/format/GsTextUtils.java @@ -327,7 +327,8 @@ public static void forEachline(final CharSequence text, GsCallback.b3