Skip to content

Commit

Permalink
Reformat code, by @gsantner
Browse files Browse the repository at this point in the history
  • Loading branch information
gsantner committed Dec 1, 2021
1 parent 4195eef commit 5d1ce8a
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ public String convertMarkup(String markup, Context context, boolean isExportInLi

private String escapeSpacesInLink(final String markup) {
final Matcher matcher = linkPattern.matcher(markup);
if (!matcher.find()){
if (!matcher.find()) {
return markup;
}

Expand All @@ -260,7 +260,7 @@ private String escapeSpacesInLink(final String markup) {
do {
final String url = matcher.group(2);
final String title = matcher.group(3);
if (url == null){
if (url == null) {
return markup;
}
sb.append(markup.substring(previousEnd, matcher.start())).append(String.format("[%s](%s%s)", matcher.group(1),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,31 +80,27 @@ public static class Group {
public String queryType;
public List<String> keys;
public boolean isAnd;
};
}

/**
* Save a 'filter view'
*
* Filters are saved as a json string in SAVED_TODO_VIEWS as array of objects:
* [
* {
* TITLE: (string) tile string,
* TYPE: (string) query type,
* IS_AND: (boolean) if query is AND or ANY
* KEYS: [ key1, key2, key3 ... ]
* },
* {
* ...
* }
* ]
* Save a 'filter view' - Filters are saved as a json string in SAVED_TODO_VIEWS as array of objects
*
* @param context context
* @param saveTitle title
* @param queryType query type (one of PRIORITY, CONTEXT, PRIORITY or DUE)
* @param selKeys List of keys
* @param isAnd Whether task should have ALL the keys or ANY
* @param context context
* @param saveTitle title
* @param queryType query type (one of PRIORITY, CONTEXT, PRIORITY or DUE)
* @param selKeys List of keys
* @param isAnd Whether task should have ALL the keys or ANY
*/
public static void saveFilter(final Context context, final String saveTitle, final String queryType, final Collection<String> selKeys, final boolean isAnd) {
/*
[{
TITLE: (string) tile string,
TYPE: (string) query type,
IS_AND: (boolean) if query is AND or ANY
KEYS: [ key1, key2, key3 ... ]
},
{.... }, {.... }]
*/
try {
// Create the view dict
final JSONObject obj = new JSONObject();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import android.support.v4.content.ContextCompat;
import android.support.v7.app.AlertDialog;
import android.support.v7.widget.AppCompatEditText;
import android.text.InputType;
import android.text.TextUtils;
import android.view.KeyEvent;
import android.view.View;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import android.support.v7.app.AlertDialog;
import android.support.v7.widget.AppCompatEditText;
import android.text.Editable;
import android.text.InputType;
import android.text.TextWatcher;
import android.view.LayoutInflater;
import android.view.View;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,9 @@ public Highlighter getHighlighter() {
}

public void enableHighlighterAutoFormat() {
postDelayed(() -> {setFilters(new InputFilter[]{_hl.getAutoFormatter()});}, 10);
postDelayed(() -> {
setFilters(new InputFilter[]{_hl.getAutoFormatter()});
}, 10);

final TextWatcher modifier = (_hl != null) ? _hl.getTextModifier() : null;
if (modifier != null && !_appliedModifiers.contains(modifier)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,9 @@

import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.support.customtabs.CustomTabsIntent;
import android.support.v4.content.ContextCompat;
import android.webkit.WebView;
import android.webkit.WebViewClient;

import net.gsantner.markor.R;
import net.gsantner.markor.activity.DocumentActivity;
import net.gsantner.markor.format.TextFormat;
import net.gsantner.markor.model.Document;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -403,8 +403,7 @@ private static View makeTitleView(final Context context, final DialogOptions dop
return titleLayout;
}

private static View makeSearchView(final Context context, final DialogOptions dopt)
{
private static View makeSearchView(final Context context, final DialogOptions dopt) {
final ContextUtils cu = new ContextUtils(context);
final int margin = (int) cu.convertDpToPx(8);
cu.freeContextRef();
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/net/gsantner/opoc/util/ShareUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -971,7 +971,7 @@ public void enableChromeCustomTabsForOtherBrowsers(final Intent customTabIntent)
}
}

public boolean openWebpageInChromeCustomTab(final String url){
public boolean openWebpageInChromeCustomTab(final String url) {
boolean ok = false;
ContextUtils cu = new ContextUtils(_context);
try {
Expand Down

0 comments on commit 5d1ce8a

Please sign in to comment.