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

Implementation changes and extensions #20

Open
wants to merge 24 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
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
Prev Previous commit
Next Next commit
Intermediate commit
new concepts and fixes
- app specific style sheets
- handler for location of userstyle.css in external storage
- added code highlighting library
Bug Fixes to properly display widget when
- size modified
- widget created for the first time
Known problems
- widgets to update after change of userstyle.css
- update mechanism added, but not functional
  • Loading branch information
Mick2nd committed May 15, 2024
commit 9914d6e3e85eda0ea7eb7697d3331d02fe6800c5
15 changes: 1 addition & 14 deletions .idea/deploymentTargetDropDown.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 24 additions & 3 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,24 +1,46 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.MarkdownWidget"
android:usesCleartextTraffic="true">
android:usesCleartextTraffic="true" >

<meta-data android:name="android.webkit.WebView.EnableSafeBrowsing"
android:value="false" />

<receiver
android:name=".PackageReplacedReceiver"
android:enabled="true"
android:exported="true">
<intent-filter>
<category android:name="android.intent.category.HOME" />
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.MY_PACKAGE_REPLACED" />
</intent-filter>
</receiver>

<service
android:name=".UpdateService"
android:enabled="true"
android:exported="false" />
android:exported="true"
android:permission="android.permission.FOREGROUND_SERVICE"
android:foregroundServiceType="dataSync"/>

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

<meta-data
@@ -36,7 +58,6 @@
<action android:name="android.appwidget.action.APPWIDGET_CONFIGURE" />
</intent-filter>
</activity>

<activity
android:name=".MainActivity"
android:exported="true">
54 changes: 54 additions & 0 deletions app/src/main/assets/default.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
.md_body {
background: yellow;
transform: scale(0.7);
transform-origin: 20% 0%;
height: 100%;
width: auto;
}

h1 {
}

.md_table {
border: 1px solid black;
}

.md_table th, .md_table td {
border: 1px solid black;
padding: 5px;
}

.md_table caption {
font-weight: bold;
}

ul:has(.md_task_item) {
list-style: none;
}

.md_task_item {
}

.mermaid {
}

blockquote {
background: #f9f9f9;
border-left: 10px solid #ccc;
margin: 1.5em 10px;
padding: 0.5em 10px;
quotes: "\201C""\201D""\2018""\2019";
}

blockquote:before {
color: #ccc;
content: open-quote;
font-size: 4em;
line-height: 0.1em;
margin-right: 0.25em;
vertical-align: -0.4em;
}

blockquote p {
display: inline;
}
Binary file added app/src/main/assets/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
782 changes: 782 additions & 0 deletions app/src/main/assets/highlight.min.js

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions app/src/main/assets/hl-default.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions app/src/main/assets/index-alt.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Html Page</title>
<meta charset="utf-8" />
<link rel="icon" type="image/x-icon" href="favicon.png" />
</head>
<body>
<!-- PLACEHOLDER for rendered markdown -->
<div id="markdown">
</div>
<h1>The MAIN Title</h1>
<p>A paragraph</p>
<p>A paragraph 2</p>
<h2>A Sub Title</h2>
<p>A paragraph 3</p>
<p>A paragraph 4</p>
<p>A paragraph 5</p>
<p>A paragraph 6</p>
</body>
</html>
15 changes: 13 additions & 2 deletions app/src/main/assets/index.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,22 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<!--
All src or href attributes are either relative to the assets folder (app supplied)
or to the user configured external Documents folder (true only for userstyle.css)
(configured here with the /documents-public folder)
-->
<link rel="icon" type="image/x-icon" href="favicon.png" />
<link rel="stylesheet" href="katex.min.css" type="text/css" />
<link rel="stylesheet" href="mermaid.min.css" type="text/css" />
<link rel="stylesheet" href="admonition.css" type="text/css" />
<link rel="stylesheet" href="https://appassets.androidplatform.net/public/userstyle.css" type="text/css" />
<link rel="stylesheet" href="hl-default.min.css" type="text/css" />
<link rel="stylesheet" href="default.css" type="text/css" />
<link rel="stylesheet" href="/documents-public/userstyle.css" type="text/css" />
<script type="text/javascript" src="katex.min.js"></script>
<script type="text/javascript" src="mermaid.min.js"></script>
<script type="text/javascript" src="highlight.min.js"></script>
<script>
mermaid.initialize({ startOnLoad: false });
</script>
@@ -92,7 +102,7 @@
</style>
<title>Html Page</title>
</head>
<body>
<body class="md_body">
<!-- PLACEHOLDER for rendered markdown -->
<div id="markdown">
</div>
@@ -107,6 +117,7 @@
renderKatex();
renderMermaid();
admonitionHelper();
hljs.highlightAll();
}
catch(e) {
console.log('Error:' , e.message);
Loading