started seperation of container styles, new 0.1.6 release
This commit is contained in:
parent
4cf86ba755
commit
ff5c572117
|
@ -4,15 +4,15 @@ plugins {
|
|||
}
|
||||
|
||||
android {
|
||||
namespace = "com.example.satsmonitor"
|
||||
namespace = "com.example.satworth"
|
||||
compileSdk = 33
|
||||
|
||||
defaultConfig {
|
||||
applicationId = "com.example.satsmonitor"
|
||||
applicationId = "com.example.satworth"
|
||||
minSdk = 24
|
||||
targetSdk = 33
|
||||
versionCode = 3
|
||||
versionName = "0.1.5"
|
||||
versionCode = 4
|
||||
versionName = "0.1.6"
|
||||
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
<head>
|
||||
<link rel="stylesheet" type="text/css" href="style.css">
|
||||
<link rel="stylesheet" type="text/css" href="styles/*">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
</head>
|
||||
<body>
|
||||
|
@ -11,7 +12,7 @@
|
|||
<label for="theme-select"> </label>
|
||||
<select id="theme-select">
|
||||
<option value="usd">Dark</option>
|
||||
<option value="ars">Alt</option>
|
||||
<option value="ars">wip</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="currency-dropdown">
|
||||
|
|
|
@ -21,7 +21,7 @@ function updateSatsToDollarsConversion() {
|
|||
})
|
||||
.catch(error => console.error(error));
|
||||
} else {
|
||||
dollarsOutputElement.textContent = 'Invalid input';
|
||||
dollarsOutputElement.textContent = '';
|
||||
}
|
||||
}
|
||||
|
|
@ -11,8 +11,12 @@ body {
|
|||
text-align: center;
|
||||
}
|
||||
|
||||
p {
|
||||
font-size: 6px;
|
||||
}
|
||||
|
||||
h1 {
|
||||
color: #ff7500;
|
||||
color: #f7931a;
|
||||
}
|
||||
|
||||
a {
|
||||
|
@ -23,62 +27,6 @@ a:hover {
|
|||
color: rgb(149, 0, 207);
|
||||
}
|
||||
|
||||
.settings {
|
||||
width: auto;
|
||||
margin-left: 20px;
|
||||
margin-right: 20px;
|
||||
margin-top: 20px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background-color: #282828;
|
||||
border: 3px solid #ccc;
|
||||
border-radius: 8px;
|
||||
padding: 10px;
|
||||
box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
|
||||
.settings img {
|
||||
width: 25px;
|
||||
height: 25px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.cog-image {
|
||||
margin-right: 20px; /* Add margin to separate cog image from dropdowns */
|
||||
}
|
||||
|
||||
.theme-dropdown,
|
||||
.currency-dropdown {
|
||||
flex: 1; /* Distribute available space equally among dropdowns */
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end; /* Align theme dropdown to the right */
|
||||
margin-right: 10px; /* Add some space between the dropdowns */
|
||||
}
|
||||
|
||||
.currency-dropdown {
|
||||
justify-content: center; /* Align currency dropdown to the center */
|
||||
}
|
||||
|
||||
#theme-select,
|
||||
#currency-select {
|
||||
width: fit-content;
|
||||
height: 40px;
|
||||
padding: 8px;
|
||||
background-color: #282828;
|
||||
border: 3px solid #ccc;
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
|
||||
font-family: monospace;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
#currency-select img {
|
||||
width: 70px;
|
||||
height: 38px;
|
||||
border-radius:2px
|
||||
}
|
||||
|
||||
.container {
|
||||
width: auto;
|
||||
margin-left: 20px;
|
||||
|
@ -134,6 +82,10 @@ a:hover {
|
|||
box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
|
||||
align-items: center; /* Center items vertically within the container */
|
||||
justify-content: center; /* Center items horizontally within the container */
|
||||
color: #ffffff;
|
||||
font-family: monospace, Arial;
|
||||
font-size: 20px;
|
||||
font-style: bolder;
|
||||
}
|
||||
|
||||
.satstodollars {
|
||||
|
@ -151,12 +103,12 @@ a:hover {
|
|||
}
|
||||
|
||||
#sats-input {
|
||||
font-size: 16px;
|
||||
font-size: 18px;
|
||||
border-radius: 7px;
|
||||
font-family: monospace;
|
||||
background: #282828;
|
||||
font-style: bolder;
|
||||
color: rgb(196, 140, 0);
|
||||
color: #f7931a;
|
||||
margin-right: 5px;
|
||||
padding-right: 5px;
|
||||
text-align: center;
|
||||
|
|
|
@ -0,0 +1,55 @@
|
|||
.settings {
|
||||
width: auto;
|
||||
margin-left: 20px;
|
||||
margin-right: 20px;
|
||||
margin-top: 20px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background-color: #282828;
|
||||
border: 3px solid #ccc;
|
||||
border-radius: 8px;
|
||||
padding: 10px;
|
||||
box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
|
||||
.settings img {
|
||||
width: 25px;
|
||||
height: 25px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.cog-image {
|
||||
margin-right: 20px; /* Add margin to separate cog image from dropdowns */
|
||||
}
|
||||
|
||||
.theme-dropdown,
|
||||
.currency-dropdown {
|
||||
flex: 1; /* Distribute available space equally among dropdowns */
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end; /* Align theme dropdown to the right */
|
||||
margin-right: 10px; /* Add some space between the dropdowns */
|
||||
}
|
||||
|
||||
.currency-dropdown {
|
||||
justify-content: center; /* Align currency dropdown to the center */
|
||||
}
|
||||
|
||||
#theme-select,
|
||||
#currency-select {
|
||||
width: fit-content;
|
||||
height: 40px;
|
||||
padding: 8px;
|
||||
background-color: #282828;
|
||||
border: 3px solid #ccc;
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
|
||||
font-family: monospace;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
#currency-select img {
|
||||
width: 70px;
|
||||
height: 38px;
|
||||
border-radius:2px
|
||||
}
|
|
@ -4,7 +4,7 @@ import androidx.appcompat.app.AppCompatActivity
|
|||
import android.os.Bundle
|
||||
import android.webkit.WebView
|
||||
import android.webkit.WebSettings
|
||||
import com.example.satsmonitor.R
|
||||
import com.example.satworth.R
|
||||
import java.io.IOException
|
||||
|
||||
class MainActivity : AppCompatActivity() {
|
||||
|
@ -36,7 +36,7 @@ class MainActivity : AppCompatActivity() {
|
|||
}
|
||||
|
||||
val assetManager = assets
|
||||
val scriptFiles = listOf("viewBitcoinPrice.js", "viewFiatToSats.js", "selectCurrency.js", "calcSatsToFiat.js")
|
||||
val scriptFiles = listOf("scripts/viewBitcoinPrice.js", "scripts/viewFiatToSats.js", "scripts/selectCurrency.js", "scripts/calcSatsToFiat.js")
|
||||
|
||||
val scriptContents = scriptFiles.map { fileName ->
|
||||
try {
|
||||
|
@ -47,18 +47,21 @@ class MainActivity : AppCompatActivity() {
|
|||
}
|
||||
}
|
||||
|
||||
val cssCode = try {
|
||||
assetManager.open("style.css").bufferedReader().use { it.readText() }
|
||||
} catch (e: IOException) {
|
||||
e.printStackTrace()
|
||||
"/* Error loading style.css */"
|
||||
val cssFiles = listOf("style.css", "styles/settings.css") // List of your CSS files
|
||||
|
||||
val cssCode = cssFiles.joinToString("\n") { fileName ->
|
||||
try {
|
||||
assetManager.open(fileName).bufferedReader().use { it.readText() }
|
||||
} catch (e: IOException) {
|
||||
e.printStackTrace()
|
||||
"/* Error loading $fileName */"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
val javaScriptCode = scriptContents.joinToString("\n")
|
||||
|
||||
|
||||
// Combine the HTML, CSS, and JavaScript code
|
||||
val finalHtmlContent = """
|
||||
val finalHtmlContent = """
|
||||
<html>
|
||||
<head>
|
||||
<style type="text/css">$cssCode</style>
|
||||
|
@ -70,9 +73,9 @@ val finalHtmlContent = """
|
|||
</html>
|
||||
""".trimIndent()
|
||||
|
||||
// Define the base URL for resolving relative paths (e.g., image source)
|
||||
// Define the base URL for resolving relative paths (e.g., image source)
|
||||
val baseUrl = "file:///android_asset/"
|
||||
|
||||
webView.loadDataWithBaseURL(null, finalHtmlContent, "text/html", "UTF-8", null)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue