fixed exchange drawing over rest of app when keyboard is pulled up

This commit is contained in:
0ceanSlim 2023-08-11 10:04:35 -04:00
parent 33cc212922
commit 86706f60e1
5 changed files with 21 additions and 6 deletions

View File

@ -1 +1 @@
SatWorth Sats Monitor

View File

@ -11,8 +11,8 @@ android {
applicationId = "com.example.satworth" applicationId = "com.example.satworth"
minSdk = 24 minSdk = 24
targetSdk = 33 targetSdk = 33
versionCode = 4 versionCode = 5
versionName = "0.1.6" versionName = "0.1.61"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
} }

View File

@ -0,0 +1,15 @@
let initialHeight = window.innerHeight;
function adjustExchangePosition() {
const currentHeight = window.innerHeight;
const heightDifference = initialHeight - currentHeight;
const exchangeElement = document.getElementById('exchange');
if (heightDifference > 0) {
exchangeElement.style.transform = `translate(0, ${heightDifference}px)`;
} else {
exchangeElement.style.transform = 'translate(0, 0)';
}
}
window.addEventListener('resize', adjustExchangePosition);

View File

@ -7,7 +7,7 @@ body {
font-family: monospace, Arial; font-family: monospace, Arial;
font-size: 12px; font-size: 12px;
font-feature-settings: normal; font-feature-settings: normal;
overflow-x: hidden; overflow: hidden;
text-align: center; text-align: center;
} }
@ -120,9 +120,9 @@ a:hover {
border-radius: 10px; border-radius: 10px;
padding: 20px; padding: 20px;
text-align: center; text-align: center;
position: fixed;
bottom: 10px; bottom: 10px;
right: 10px; right: 10px;
position: fixed;
} }
/* CSS for the text */ /* CSS for the text */

View File

@ -36,7 +36,7 @@ class MainActivity : AppCompatActivity() {
} }
val assetManager = assets val assetManager = assets
val scriptFiles = listOf("scripts/viewBitcoinPrice.js", "scripts/viewFiatToSats.js", "scripts/selectCurrency.js", "scripts/calcSatsToFiat.js") val scriptFiles = listOf("scripts/viewBitcoinPrice.js", "scripts/viewFiatToSats.js", "scripts/selectCurrency.js", "scripts/calcSatsToFiat.js","scripts/transformExchange.js")
val scriptContents = scriptFiles.map { fileName -> val scriptContents = scriptFiles.map { fileName ->
try { try {