Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

fix titlebar on android editor

ammarahm-ed5de6004c1f56
diff --git a/apps/mobile/android/app/src/main/assets/constants.js b/apps/mobile/android/app/src/main/assets/constants.js
index 801ad8747..341769f49 100644
--- a/apps/mobile/android/app/src/main/assets/constants.js
+++ b/apps/mobile/android/app/src/main/assets/constants.js
@@ -265,7 +265,6 @@ const setTheme = function () {
}
.ql-snow.ql-toolbar button,
.ql-snow .ql-toolbar button {
-
height: ${pageTheme.colors.factor * 32};
width: ${pageTheme.colors.factor * 36};
}
@@ -290,18 +289,12 @@ const setTheme = function () {
#titleInput {
color:${pageTheme.colors.heading};
- font-size:${32 * 1.5 * pageTheme.colors.factor};
-
- }
-
- #titlebar {
- background-color:${pageTheme.colors.shade};
+ font-size:${32 * pageTheme.colors.factor};
}
#textCopy {
color:${pageTheme.colors.pri};
- font-size:${32 * 1.5 * pageTheme.colors.factor};
-
+ font-size:${32 * pageTheme.colors.factor};
}
#titleInput::-webkit-input-placeholder {
color:${pageTheme.colors.icon}
@@ -354,10 +347,6 @@ const setTheme = function () {
height:50px;
color:${pageTheme.colors.heading}
}
- .info-bar {
- margin-bottom:${isTablet ? '12px !important' : '0px !important'};
- padding-left:12px;
- }
#titlebarAlt {
height:50px;
@@ -373,11 +362,7 @@ const setTheme = function () {
font-family: 'Poppins', sans-serif;
margin: 0px;
position: relative;
- height:${
- isTablet
- ? 'calc(100% - 260px) !important'
- : 'calc(100% - 110px) !important'
- };
+ height:calc(100% - 115px) !important
}
diff --git a/apps/mobile/android/app/src/main/assets/listeners.js b/apps/mobile/android/app/src/main/assets/listeners.js
index 2423633c0..47045781e 100644
--- a/apps/mobile/android/app/src/main/assets/listeners.js
+++ b/apps/mobile/android/app/src/main/assets/listeners.js
@@ -72,21 +72,32 @@ function onTitleChange(ele) {
function autosize() {
if (isTablet) {
- document.getElementById('textCopy').innerHTML = document
+ let ele = document.getElementById('textCopy');
+ ele.innerHTML = document
.getElementById(titleInput)
.value.replace(/\n/g, '<br/>');
+ console.log(document.getElementById('titlebar').scrollHeight);
+ let newHeight = document.getElementById('titlebar').scrollHeight;
+ let css = document.createElement('style');
+ css.type = 'text/css';
+ let node = `
+ .ql-container {
+ box-sizing: border-box;
+ font-family: 'Poppins', sans-serif;
+ margin: 0px;
+ position: relative;
+ height:calc(100% - ${newHeight + 65}px) !important
+ };
+ `;
+ css.appendChild(document.createTextNode(node));
+ document.getElementsByTagName('head')[0].appendChild(css);
}
}
function attachEditorListeners() {
- /* editor.once('text-change', function () {
- window.ReactNativeWebView.postMessage('loaded');
- }); */
titleInput = isTablet ? 'titleInput' : 'simpleTitleInput';
infoBar = isTablet ? '.info-bar' : '.info-bar-alt';
-
-
function isWhitespace(ch) {
let whiteSpace = false;
if (ch === ' ' || ch === '\t' || ch === '\n') {
diff --git a/apps/mobile/android/app/src/main/assets/styles.css b/apps/mobile/android/app/src/main/assets/styles.css
index e7757ce07..d278ee79d 100644
--- a/apps/mobile/android/app/src/main/assets/styles.css
+++ b/apps/mobile/android/app/src/main/assets/styles.css
@@ -34,6 +34,7 @@
outline: none;
overflow-y: hidden;
padding: 12px 12px;
+ padding-top: 0px;
tab-size: 4;
-moz-tab-size: 4;
text-align: left;
@@ -1083,6 +1084,7 @@
border: none;
width: 100%;
outline: none;
+ resize: none;
}
#formBox {
@@ -1094,7 +1096,7 @@
background-color: transparent;
padding-left: 12px;
padding-right: 12px;
- min-height: 195px;
+ min-height: 45px;
display: flex;
flex-direction: column;
justify-content: flex-end;
@@ -1119,7 +1121,7 @@
#formBox > div {
visibility: hidden;
- min-height: 60px;
+ min-height: 45px;
}
.info-bar {
@@ -1129,7 +1131,8 @@
height: 20px;
font-family: 'Poppins';
margin-top: -8px;
- margin-bottom: 12px;
+ margin-bottom: 6px ;
+ padding-left: 0px !important;
}
#titlebar textarea:focus {
diff --git a/apps/mobile/android/app/src/main/assets/texteditor.html b/apps/mobile/android/app/src/main/assets/texteditor.html
index 393ea64cb..1bd729053 100644
--- a/apps/mobile/android/app/src/main/assets/texteditor.html
+++ b/apps/mobile/android/app/src/main/assets/texteditor.html
@@ -53,7 +53,7 @@
</body>
<script>
let editor;
- let isTablet = false;
+ let isTablet = true;
</script>
<script src="quill.js"></script>
<script src="constants.js"></script>
@@ -442,8 +442,8 @@
},
};
attachMessageListener();
- function loadAction(premium, tab) {
- isTablet = tab;
+ function loadAction(premium) {
+ isTablet = true;
setFonts();
Quill.register("modules/imageCompressor", imageCompressor);
Quill.register("formats/lists", BetterList);
@@ -530,6 +530,7 @@
}
}
+ loadAction(true)
</script>
diff --git a/apps/mobile/html/Web.bundle/site/constants.js b/apps/mobile/html/Web.bundle/site/constants.js
index a55852fb1..342016d99 100644
--- a/apps/mobile/html/Web.bundle/site/constants.js
+++ b/apps/mobile/html/Web.bundle/site/constants.js
@@ -290,7 +290,6 @@ const setTheme = function () {
#textCopy {
color:${pageTheme.colors.pri};
font-size:${32 * pageTheme.colors.factor};
- min-height: ${32 * pageTheme.colors.factor + 6};
}
@@ -349,7 +348,6 @@ const setTheme = function () {
color:${pageTheme.colors.heading}
}
.info-bar {
- margin-bottom:${isTablet ? '12px !important' : '0px !important'};
padding-left:12px;
}
diff --git a/apps/mobile/html/Web.bundle/site/styles.css b/apps/mobile/html/Web.bundle/site/styles.css
index 015cff84e..c053eeecd 100644
--- a/apps/mobile/html/Web.bundle/site/styles.css
+++ b/apps/mobile/html/Web.bundle/site/styles.css
@@ -1093,6 +1093,7 @@
border: none;
width: 100%;
outline: none;
+ resize: none;
}
#formBox {
@@ -1104,7 +1105,7 @@
background-color: transparent;
padding-left: 12px;
padding-right: 12px;
- min-height: 60px;
+ min-height: 45px;
display: flex;
flex-direction: column;
justify-content: flex-end;
@@ -1135,6 +1136,7 @@
#formBox > div {
visibility: hidden;
+ min-height: 45px;
}
.info-bar {
@@ -1144,7 +1146,7 @@
height: 20px;
font-family: 'Poppins';
margin-top: -8px;
- margin-bottom: 12px;
+ margin-bottom: 6px;
}
#titlebar textarea:focus {
outline: none;