Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] master from gsantner:master #219

Open
wants to merge 40 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
c4ba9e7
Appearance improvements (PR #2359 closes #2358)
harshad1 Jul 23, 2024
3f06793
Update translations (PR #2356)
gsantner Jul 23, 2024
dab3aa8
ShareInto: Fix crash when _editor is null
gsantner Jul 26, 2024
d8cd590
SearchReplace dialog: Use full width, closes #2367, by @gsantner
gsantner Jul 26, 2024
885f394
Add links to changelog
gsantner Jul 26, 2024
446d4f9
Markor v2.12.4 (153)
gsantner Jul 26, 2024
9f4f6f5
Latest Android SDK/Gradle fixes, by @gsantner #2360
gsantner Jul 27, 2024
19e0cdc
New Color picker, bump Android minSdk from 16 to 18, closes #1428 (PR…
halfdane Jul 27, 2024
be4ab7f
Update translations(#2368)
gsantner Jul 27, 2024
57aaf0f
Various bugfixes (anchor/toc jumping #2364, snippets folder #2369, wi…
harshad1 Jul 27, 2024
80e813e
Add history scroll restoration for scroll views (#2366)
guanglinn Jul 27, 2024
3a506e2
Zim: Fix link/attachment format (PR #2147 by @mehw)
mehw Jul 27, 2024
bc73060
DocumentEditAndViewFragment: Fix all warnings, especially related to …
gsantner Jul 27, 2024
a3cc214
Markor v2.12.5 (154)
gsantner Jul 27, 2024
ca79c62
Add usual yyyy-MM-dd newfile default option
gsantner Jul 30, 2024
e8acb72
Fix inject-head js option not applying, closes #2365, closes #2380 (P…
guanglinn Aug 2, 2024
0dd9afa
Minor doc improvements
gsantner Aug 18, 2024
9cf3f92
Update translations (PR #2376)
gsantner Aug 18, 2024
92b30e1
Filebrowser: Fix file modification time not reloaded, closes #2196 (P…
guanglinn Aug 18, 2024
ef1e024
Update translations (PR #2413)
gsantner Sep 16, 2024
c5fe529
Navigation and highlighting improvements (PR #2377 closes #2409 close…
harshad1 Sep 16, 2024
8ac73f8
Updated README with dark/light todo.txt format images (PR #2411)
AntoninDelFabbro Sep 16, 2024
ea066b6
GitHub Actions CI configuration - upgrade upload step, fixes CI build…
gsantner Sep 16, 2024
d4183ef
Add Em Space special key for paragraph indent (#2400)
guanglinn Sep 18, 2024
169664f
Fix how multiple windows are launched (PR #2419)
harshad1 Sep 19, 2024
dcd77e2
Fixed checking for indices (#2421)
harshad1 Sep 20, 2024
40932ca
Disable multi-window settings option by default (PR #2420)
elyahw Sep 24, 2024
f31cfa7
Update translations (PR #2418)
gsantner Sep 24, 2024
d161e62
Create launcher widget for todo (closes #1997, PR #2379)
wshoy Sep 24, 2024
c445821
Improvements for the action buttons (closes #2386, PR #2388)
wshoy Sep 24, 2024
cdd623e
Improvements for HeadlineDialog scroll restoration and copy code bloc…
guanglinn Sep 24, 2024
9b974c9
Bugfix: showAndFlash must be called on UI thread, closes #2427 (#2428)
harshad1 Oct 3, 2024
ed3f20f
Update translations (#2425)
gsantner Oct 3, 2024
f8aab77
TextAction: Add text case changing functionality (closes #2390, PR #2…
zeuchie Oct 11, 2024
86632d5
Open .lrc extension as plaintext by default, closes #2322 (#2438)
gsantner Oct 13, 2024
b492872
Register chess extension (.fen) for plaintext - https://en.wikipedia.…
gsantner Oct 13, 2024
6ae8ea3
Update translations (PR #2434)
gsantner Oct 13, 2024
b282167
FileManager: Remove top submenu to open special folders, load storage…
gsantner Oct 13, 2024
4859af9
Rework /storage mapped folders (PR #2445 by @gsantner)
gsantner Oct 14, 2024
fd14805
orgmode: fix action buttons not being loaded correctly (PR #2449)
nyxkn Oct 21, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build-android-project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,14 @@ jobs:

- name: "Artifacts: All"
if: always()
uses: actions/upload-artifact@v2.2.1
uses: actions/upload-artifact@v4
with:
name: "all"
path: dist
retention-days: 5

- name: "Artifacts: Android APK"
uses: actions/upload-artifact@v2.2.1
uses: actions/upload-artifact@v4
with:
name: "android-apk"
path: |
Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
### Recent changes
- See [Discussions](https://github.com/gsantner/markor/discussions), [Issues](https://github.com/gsantner/markor/issues) and [Project news](https://github.com/gsantner/markor/blob/master/NEWS.md) to see what is going on.
- New Updates also visible here: <https://github.com/gsantner/markor/releases>

### v2.12 series
- [2.12.0](https://github.com/gsantner/markor/compare/v2.11.1...v2.12.0)
- [2.12.1](https://github.com/gsantner/markor/compare/v2.12.0...v2.12.1)
- [2.12.2](https://github.com/gsantner/markor/compare/v2.12.1...v2.12.2)
- [2.12.3](https://github.com/gsantner/markor/compare/v2.12.2...v2.12.3)
- [2.12.4](https://github.com/gsantner/markor/compare/v2.12.3...v2.12.4)
- [2.12.5](https://github.com/gsantner/markor/compare/v2.12.4...v2.12.5)
- [2.12.6](https://github.com/gsantner/markor/compare/v2.12.5...v2.12.6)

### v2.11 ([Details](https://github.com/gsantner/markor/blob/master/NEWS.md#markor-v211---asciidoc-csv-and-org-mode-todotxt-advanced-search-line-numbers))
- Reworked attachments (PR #2106 by @harshad1)
Expand Down
5 changes: 3 additions & 2 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Where:
* **[Kanthi Subramanian](https://github.com/subkanthi)**<br/>~° File Info Dialog
* **[Emanuele Petriglia](https://github.com/ema-pe)**<br/>~° Italian translation
* **[Tiago Danin](https://tiagodanin.github.io)**<br/>~° Brazilian Portuguese translation
* **[Jesica Chu](https://github.com/jesicachu)**<br/>~° Spanish and Traiditonal Chinese translation
* **[Jesica Chu](https://github.com/jesicachu)**<br/>~° Spanish and Traditional Chinese translation
* **[Ankush S Shetkar](https://www.linkedin.com/in/livelycoder/)**<br/>~° Added Chrome custom tabs for urls
* **[Lars Pontoppidan](https://github.com/larpon)**<br/>~° Danish translation
* **[Amaya Lim](https://github.com/nightrainlily)**<br/>~° Improved project description
Expand All @@ -42,7 +42,7 @@ Where:
* **[Vladislav Glinsky](https://github.com/cl0ne)**<br/>~° Ukrainian/Russian translations
* **[David Hebbeker](https://david.hebbeker.info/)**<br/>~° Added tooltips for text actions
* **[Harshad Srinivasan](https://github.com/harshad1)**<br/>~° Added functionality to handle leading spaces in lists
* **[Niels](https://stackoverflow.com/users/432115/niels)**<br/>~° Added encryption for textfile contents
* **[Niels](https://stackoverflow.com/users/432115/niels)**<br/>~° Added encryption for text file contents
* **[Helguli](https://github.com/Helguli)**<br/>~° Added fast scroll to editor
* **[Patricia Heimfarth](https://github.com/PatriciaHeimfarth)**<br/>~° Added checkbox for todo completion date
* **[Peter Schwede](https://github.com/pschwede)**<br/>~° Added Zim-Wiki support
Expand All @@ -52,4 +52,5 @@ Where:
* **[Li Guanglin](https://github.com/guanglinn)**<br/>~° Added line numbers support
* **[bigger124](https://github.com/bigger124)**<br>~° Added OrgMode-Support
* **[Ayowel](https://github.com/ayowel)**<br>~° Mermaid update
* **[Matthew White](https://github.com/mehw)**<br>~° Zim-Wiki link/attachment conformance
* **[Markus Paintner](https://github.com/goli4thus)**<br/>~° Added duplicate lines action
1 change: 0 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ If you have questions or found an issue please head to the [Markor project](http
* [**FAQ**](README.md#FAQ)
* [File browser, file management](README.md#file-browser--file-management)
* [Format: Markdown](README.md#format-markdown)
* [Format: Markdown](README.md#format-markdown)
* [Format: todo.txt](README.md#format-todotxt)
* [**More**](doc)
* [Synced plaintext TODO and notes - Vim / Vimwiki, Markor Android, Syncthing, GTD (Pitt)](doc/2020-09-26-vimwiki-sync-plaintext-to-do-and-notes-todotxt-markdown.md#readme)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ There is no dedicated view mode implemented.
* [**FAQ**](README.md#FAQ)
* [File browser, file management](README.md#file-browser--file-management)
* [Format: Markdown](README.md#format-markdown)
* [Format: Markdown](README.md#format-markdown)
* [Format: todo.txt](README.md#format-todotxt)
* [**More**](doc)
* [Synced plaintext TODO and notes - Vim / Vimwiki, Markor Android, Syncthing, GTD (Pitt)](doc/2020-09-26-vimwiki-sync-plaintext-to-do-and-notes-todotxt-markdown.md)
Expand Down Expand Up @@ -256,7 +255,8 @@ Todo.txt is a simple text format for todo. Each line of text is a task. The idea
| [User Documentation](https://github.com/todotxt/todo.txt-cli/wiki/User-Documentation) | User documentation |


![todotxt](doc/assets/todotxt-format.png)
![todotxt](doc/assets/todotxt-format-dark.png#gh-dark-mode-only)
![todotxt](doc/assets/todotxt-format.png#gh-light-mode-only)

#### How to mark a task done?
Done tasks are marked by a `x ` in begining of the line and can optionally be moved to a done/archive file.
Expand Down
12 changes: 6 additions & 6 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ if (enable_plugin_kotlin) {
apply plugin: 'kotlin-kapt'
}

rootProject.ext.version_minSdk = 16
rootProject.ext.version_minSdk = 18

// https://github.com/vsch/flexmark-java/releases
ext.version_library_flexmark = "0.42.14"
Expand All @@ -25,8 +25,8 @@ android {
defaultConfig {
resValue "string", "manifest_package_id", "net.gsantner.markor"
applicationId "net.gsantner.markor"
versionName "2.12.3"
versionCode 152
versionName "2.12.5"
versionCode 154

multiDexEnabled true
minSdkVersion rootProject.ext.version_minSdk
Expand Down Expand Up @@ -138,11 +138,11 @@ dependencies {


// UI libs
implementation 'com.pixplicity.generate:library:1.1.8'
implementation 'com.github.Pixplicity:gene-rate:v1.1.8'
implementation 'com.github.AppIntro:AppIntro:6.2.0'
implementation 'com.kailashdabhi:om-recorder:1.1.5'
implementation 'com.github.kailash09dabhi:OmRecorder:1.1.5'
implementation 'com.github.mertakdut:EpubParser:1.0.95'
implementation project(':app:thirdparty-lib-src:QuadFlask-colorpicker')
implementation 'com.github.martin-stone:hsv-alpha-color-picker-android:3.1.0'

// Tool libraries
//noinspection AnnotationProcessorOnCompilePath
Expand Down
20 changes: 18 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
android:name=".activity.MainActivity"
android:exported="true"
android:label="@string/app_name"
android:launchMode="singleInstance"
android:launchMode="singleTask"
android:taskAffinity=".activity.MainActivity"
android:windowSoftInputMode="stateUnchanged|adjustResize">
<intent-filter>
Expand Down Expand Up @@ -110,6 +110,22 @@
android:name="other.writeily.widget.WrFilesWidgetService"
android:permission="android.permission.BIND_REMOTEVIEWS" />

<receiver
android:name=".widget.TodoWidgetProvider"
android:exported="true">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>

<meta-data
android:name="android.appwidget.provider"
android:resource="@xml/todo_widget" />
</receiver>

<service
android:name=".widget.TodoWidgetService"
android:permission="android.permission.BIND_REMOTEVIEWS" />

<provider
android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.provider"
Expand Down Expand Up @@ -167,7 +183,7 @@
</activity>
<activity
android:name=".activity.openeditor.OpenFromShortcutOrWidgetActivity"
android:launchMode="singleTop"
android:launchMode="standard"
android:theme="@android:style/Theme.NoDisplay" />
<activity
android:name=".activity.DocumentActivity"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import net.gsantner.markor.format.plaintext.PlaintextActionButtons;
import net.gsantner.markor.format.todotxt.TodoTxtActionButtons;
import net.gsantner.markor.format.wikitext.WikitextActionButtons;
import net.gsantner.markor.format.orgmode.OrgmodeActionButtons;
import net.gsantner.opoc.util.GsCollectionUtils;

import java.util.ArrayList;
Expand Down Expand Up @@ -133,6 +134,8 @@ private void extractActionData() {
_textActions = new WikitextActionButtons(this, null);
} else if (documentType == R.string.pref_key__asciidoc__reorder_actions) {
_textActions = new AsciidocActionButtons(this, null);
} else if (documentType == R.string.pref_key__orgmode__reorder_actions) {
_textActions = new OrgmodeActionButtons(this, null);
} else { // Default to Plaintext
_textActions = new PlaintextActionButtons(this, null);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,24 @@
import net.gsantner.opoc.util.GsFileUtils;

import java.io.File;
import java.util.Stack;

import other.so.AndroidBug5497Workaround;

public class DocumentActivity extends MarkorBaseActivity {
public static final String EXTRA_DO_PREVIEW = "EXTRA_DO_PREVIEW";

private Toolbar _toolbar;

private FragmentManager _fragManager;

private static boolean nextLaunchTransparentBg = false;

public static void launch(final Activity activity, final Intent intent) {
final File file = MarkorContextUtils.getIntentFile(intent, null);
final Integer lineNumber = intent.hasExtra(Document.EXTRA_FILE_LINE_NUMBER) ? intent.getIntExtra(Document.EXTRA_FILE_LINE_NUMBER, -1) : null;
final Boolean doPreview = intent.hasExtra(Document.EXTRA_DO_PREVIEW) ? intent.getBooleanExtra(Document.EXTRA_DO_PREVIEW, false) : null;
launch(activity, file, doPreview, lineNumber);
}

public static void launch(
final Activity activity,
final File file,
Expand Down Expand Up @@ -84,25 +90,27 @@ private static void launch(
final Intent intent;
if (GsFileBrowserListAdapter.isVirtualFolder(file) || file.isDirectory()) {
intent = new Intent(activity, MainActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT);
} else {
intent = new Intent(activity, DocumentActivity.class);
}

intent.putExtra(Document.EXTRA_FILE, file);
if (!(activity instanceof DocumentActivity) &&
Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP &&
as.isMultiWindowEnabled()
) {
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_DOCUMENT | Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
}

if (lineNumber != null && lineNumber >= 0) {
intent.putExtra(Document.EXTRA_FILE_LINE_NUMBER, lineNumber);
}
if (lineNumber != null) {
intent.putExtra(Document.EXTRA_FILE_LINE_NUMBER, lineNumber);
}

if (doPreview != null) {
intent.putExtra(DocumentActivity.EXTRA_DO_PREVIEW, doPreview);
if (doPreview != null) {
intent.putExtra(Document.EXTRA_DO_PREVIEW, doPreview);
}
}

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && as.isMultiWindowEnabled()) {
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_DOCUMENT | Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
} else {
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
}
intent.putExtra(Document.EXTRA_FILE, file);

nextLaunchTransparentBg = (activity instanceof MainActivity);
GsContextUtils.instance.animateToActivity(activity, intent, false, null);
Expand Down Expand Up @@ -190,7 +198,7 @@ private void handleLaunchingIntent(final Intent intent) {
final Document doc = new Document(file);
Integer startLine = null;
if (intent.hasExtra(Document.EXTRA_FILE_LINE_NUMBER)) {
startLine = intent.getIntExtra(Document.EXTRA_FILE_LINE_NUMBER, -1);
startLine = intent.getIntExtra(Document.EXTRA_FILE_LINE_NUMBER, Document.EXTRA_FILE_LINE_NUMBER_LAST);
} else if (intentData != null) {
final String line = intentData.getQueryParameter("line");
if (line != null) {
Expand All @@ -203,7 +211,7 @@ private void handleLaunchingIntent(final Intent intent) {
if (startLine != null) {
// If a line is requested, open in edit mode so the line is shown
startInPreview = false;
} else if (intent.getBooleanExtra(EXTRA_DO_PREVIEW, false) || file.getName().startsWith("index.")) {
} else if (intent.getBooleanExtra(Document.EXTRA_DO_PREVIEW, false) || file.getName().startsWith("index.")) {
startInPreview = true;
}

Expand Down Expand Up @@ -272,11 +280,11 @@ public void setDocumentTitle(final String title) {
}

public void showTextEditor(final Document document, final Integer lineNumber, final Boolean startPreview) {
final GsFragmentBase currentFragment = getCurrentVisibleFragment();
final GsFragmentBase<?, ?> currentFragment = getCurrentVisibleFragment();

final boolean sameDocumentRequested = (
currentFragment instanceof DocumentEditAndViewFragment &&
document.getPath().equals(((DocumentEditAndViewFragment) currentFragment).getDocument().getPath()));
document.path.equals(((DocumentEditAndViewFragment) currentFragment).getDocument().path));

if (!sameDocumentRequested) {
showFragment(DocumentEditAndViewFragment.newInstance(document, lineNumber, startPreview));
Expand All @@ -297,21 +305,15 @@ protected void onResume() {
@Override
@SuppressWarnings("StatementWithEmptyBody")
public void onBackPressed() {
FragmentManager fragMgr = getSupportFragmentManager();
GsFragmentBase top = getCurrentVisibleFragment();
if (top != null) {
if (!top.onBackPressed()) {
if (fragMgr.getBackStackEntryCount() == 1) {
// Back action was not handled by fragment, handle in activity
} else if (fragMgr.getBackStackEntryCount() > 0) {
// Back action was to go one fragment back
fragMgr.popBackStack();
return;
}
} else {
// Was handled by child fragment
return;
}
final int entryCount = _fragManager.getBackStackEntryCount();
final GsFragmentBase<?, ?> top = getCurrentVisibleFragment();

// We pop the stack to go back to the previous fragment
// if the top fragment does not handle the back press
// Doesn't actually get called as we have 1 fragment in the stack
if (top != null && !top.onBackPressed() && entryCount > 1) {
_fragManager.popBackStack();
return;
}

// Handle in this activity
Expand All @@ -324,10 +326,10 @@ public void onBackPressed() {

@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
return super.onReceiveKeyPress(getCurrentVisibleFragment(), keyCode, event) ? true : super.onKeyDown(keyCode, event);
return super.onReceiveKeyPress(getCurrentVisibleFragment(), keyCode, event) || super.onKeyDown(keyCode, event);
}

public GsFragmentBase showFragment(GsFragmentBase fragment) {
public GsFragmentBase<?, ?> showFragment(GsFragmentBase<?, ?> fragment) {
if (fragment != getCurrentVisibleFragment()) {
_fragManager.beginTransaction()
.replace(R.id.document__placeholder_fragment, fragment, fragment.getFragmentTag())
Expand All @@ -338,11 +340,11 @@ public GsFragmentBase showFragment(GsFragmentBase fragment) {
return fragment;
}

public synchronized GsFragmentBase getExistingFragment(final String fragmentTag) {
return (GsFragmentBase) getSupportFragmentManager().findFragmentByTag(fragmentTag);
public synchronized GsFragmentBase<?, ?> getExistingFragment(final String fragmentTag) {
return (GsFragmentBase<?, ?>) getSupportFragmentManager().findFragmentByTag(fragmentTag);
}

private GsFragmentBase getCurrentVisibleFragment() {
return (GsFragmentBase) getSupportFragmentManager().findFragmentById(R.id.document__placeholder_fragment);
private GsFragmentBase<?, ?> getCurrentVisibleFragment() {
return (GsFragmentBase<?, ?>) getSupportFragmentManager().findFragmentById(R.id.document__placeholder_fragment);
}
}
Loading