refactor: rename dashboards→webviews, unique applicationId per flavor
build / build (push) Failing after 3m11s
build / build (push) Failing after 3m11s
Each flavor gets applicationIdSuffix = ".<name>" so the Bravia getApplicationList API returns a distinct URI per webview, enabling Control4 to launch specific flavors independently. BREAKING CHANGE: applicationId changed from cz.c3c.webviewkiosk to cz.c3c.webviewkiosk.<flavor> — uninstall old app before reinstalling. BuildConfig.DASHBOARD_URL renamed to WEBVIEW_URL. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -6,8 +6,8 @@ plugins {
|
||||
}
|
||||
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
val dashboards: Map<String, Map<String, String>> =
|
||||
Yaml().load(rootProject.file("dashboards.yaml").inputStream())
|
||||
val webviews: Map<String, Map<String, String>> =
|
||||
Yaml().load(rootProject.file("webviews.yaml").inputStream())
|
||||
|
||||
android {
|
||||
namespace = "cz.c3c.webviewkiosk"
|
||||
@@ -41,13 +41,14 @@ android {
|
||||
}
|
||||
}
|
||||
|
||||
flavorDimensions += "dashboard"
|
||||
flavorDimensions += "webview"
|
||||
|
||||
productFlavors {
|
||||
dashboards.forEach { (name, config) ->
|
||||
webviews.forEach { (name, config) ->
|
||||
create(name) {
|
||||
dimension = "dashboard"
|
||||
buildConfigField("String", "DASHBOARD_URL", "\"${config["url"]}\"")
|
||||
dimension = "webview"
|
||||
applicationIdSuffix = ".$name"
|
||||
buildConfigField("String", "WEBVIEW_URL", "\"${config["url"]}\"")
|
||||
resValue("string", "app_name", config["label"] ?: name)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ class MainActivity : Activity() {
|
||||
if (!request.isForMainFrame) return
|
||||
lastLoadFailed = true
|
||||
handler.postDelayed(
|
||||
{ view.loadUrl(BuildConfig.DASHBOARD_URL) },
|
||||
{ view.loadUrl(BuildConfig.WEBVIEW_URL) },
|
||||
backoff.nextDelayMs(),
|
||||
)
|
||||
}
|
||||
@@ -58,7 +58,7 @@ class MainActivity : Activity() {
|
||||
|
||||
setContentView(webView)
|
||||
hideSystemUi()
|
||||
webView.loadUrl(BuildConfig.DASHBOARD_URL)
|
||||
webView.loadUrl(BuildConfig.WEBVIEW_URL)
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
|
||||
Reference in New Issue
Block a user