refactored scripts and html for easier recognition, renamed all instances of SatsMonitor
This commit is contained in:
parent
1b1702443c
commit
4cf86ba755
@ -12,10 +12,10 @@
|
||||
android:label="@string/app_name"
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/Theme.SatsMonitor"
|
||||
android:theme="@style/Theme.SatWorth"
|
||||
tools:targetApi="31">
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:name="com.example.satworth.MainActivity"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
@ -1,9 +1,10 @@
|
||||
package com.example.satsmonitor
|
||||
package com.example.satworth
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import android.os.Bundle
|
||||
import android.webkit.WebView
|
||||
import android.webkit.WebSettings
|
||||
import com.example.satsmonitor.R
|
||||
import java.io.IOException
|
||||
|
||||
class MainActivity : AppCompatActivity() {
|
||||
@ -24,10 +25,10 @@ class MainActivity : AppCompatActivity() {
|
||||
// Clear the WebView cache (optional)
|
||||
webView.clearCache(true)
|
||||
|
||||
// Load the HTML content from the "index.html" file
|
||||
// Load the HTML content from the "app.html" file
|
||||
val htmlContent = try {
|
||||
// Load the HTML content from the "index.html" file
|
||||
assets.open("index.html").bufferedReader().use { it.readText() }
|
||||
// Load the HTML content from the "app.html" file
|
||||
assets.open("app.html").bufferedReader().use { it.readText() }
|
||||
} catch (e: IOException) {
|
||||
e.printStackTrace()
|
||||
// If loading HTML fails, set some default content
|
||||
@ -35,7 +36,7 @@ class MainActivity : AppCompatActivity() {
|
||||
}
|
||||
|
||||
val assetManager = assets
|
||||
val scriptFiles = listOf("script.js", "script2.js", "script3.js", "script4.js")
|
||||
val scriptFiles = listOf("viewBitcoinPrice.js", "viewFiatToSats.js", "selectCurrency.js", "calcSatsToFiat.js")
|
||||
|
||||
val scriptContents = scriptFiles.map { fileName ->
|
||||
try {
|
||||
|
@ -4,7 +4,7 @@
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
tools:context=".MainActivity">
|
||||
tools:context="com.example.satworth.MainActivity">
|
||||
|
||||
<WebView
|
||||
android:id="@+id/webView"
|
||||
|
@ -1,6 +1,6 @@
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<!-- Base application theme. -->
|
||||
<style name="Base.Theme.SatsMonitor" parent="Theme.Material3.DayNight.NoActionBar">
|
||||
<style name="Base.Theme.SatWorth" parent="Theme.Material3.DayNight.NoActionBar">
|
||||
<!-- Customize your dark theme here. -->
|
||||
<!-- <item name="colorPrimary">@color/my_dark_primary</item> -->
|
||||
</style>
|
||||
|
@ -1,9 +1,9 @@
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<!-- Base application theme. -->
|
||||
<style name="Base.Theme.SatsMonitor" parent="Theme.Material3.DayNight.NoActionBar">
|
||||
<style name="Base.Theme.SatWorth" parent="Theme.Material3.DayNight.NoActionBar">
|
||||
<!-- Customize your light theme here. -->
|
||||
<!-- <item name="colorPrimary">@color/my_light_primary</item> -->
|
||||
</style>
|
||||
|
||||
<style name="Theme.SatsMonitor" parent="Base.Theme.SatsMonitor" />
|
||||
<style name="Theme.SatWorth" parent="Base.Theme.SatWorth" />
|
||||
</resources>
|
Loading…
Reference in New Issue
Block a user