diff --git a/build.gradle b/build.gradle index e63fcd90..b8f1479b 100644 --- a/build.gradle +++ b/build.gradle @@ -5,6 +5,16 @@ buildscript { google() mavenCentral() } + dependencies { + // The publish plugin is loaded here, once, and only when a publish task is requested. Loading it + // from each module's own buildscript gave every module its own copy of the plugin classes, and + // the plugin's shared Sonatype build service then failed with "cannot set property buildService + // ... loaded with a different classloader" as soon as two modules published in one build. + if (gradle.startParameter.taskNames.any { it.toLowerCase().contains("publish") }) { + // This requires minimum java 11 to work + classpath 'com.vanniktech:gradle-maven-publish-plugin:0.28.0' + } + } } allprojects { diff --git a/sdk-java-ui/README.md b/sdk-java-ui/README.md index 5da57ea0..1d6b8897 100644 --- a/sdk-java-ui/README.md +++ b/sdk-java-ui/README.md @@ -73,14 +73,18 @@ The card takes the size the widget asks for, and is anchored the way that widget the web: an NPS at the bottom centre, a survey at the bottom left or bottom right per its `appearance.position`, and a rating as a centred card. -By default that happens on the work area of the screen the application is on. To keep both widget -cards and content blocks inside the application window instead, set this once before showing -anything: +By default both widget cards and content blocks are laid out inside the application window, as a +child window that follows it. To lay them out over the work area of the screen the application is on +instead, set this once before showing anything: ```java -CountlyWebView.setShowWidgetsWithinApp(true); +CountlyWebView.setShowWidgetsWithinApp(false); ``` +Inside the window, a block that covers the whole window is clipped to rounded corners; match the +radius to your window with `CountlyWebView.setOverlayCornerRadius(radius)`, or pass `0` for square +windows. + ### Content ```java @@ -107,9 +111,10 @@ want content pinned to a particular one: CountlyWebView.enableContentZone(myWindow); ``` -The content window is shown only once its page has painted, so nothing flashes as an empty -rectangle. A page that fails to load, or does not load within 20 seconds, is abandoned and the zone -resumes fetching. +The content window is transparent, so the block appears as soon as its page draws. A page that fails +to load, or does not load within 20 seconds, is abandoned and the zone resumes fetching. Only one +widget or content block is shown at a time; a second one asked for meanwhile is reported closed at +once. Content is an **experimental** feature and its API can change. diff --git a/sdk-java-ui/build.gradle b/sdk-java-ui/build.gradle index e55941d6..5d0a2ad9 100644 --- a/sdk-java-ui/build.gradle +++ b/sdk-java-ui/build.gradle @@ -1,8 +1,8 @@ -buildscript { - repositories { - mavenCentral() - } - // A widget or content link would otherwise be handed to the real system browser while tests run. +plugins { + id 'java-library' + id 'org.openjfx.javafxplugin' version '0.1.0' +} + // // No Monocle. The headless JavaFX platform cost four separate failures: Monocle 11 threw // AbstractMethodError against JavaFX 17, Monocle 17 crashed the JVM against JavaFX 21, Monocle 21 is @@ -11,6 +11,7 @@ buildscript { // Windows). The tests now use the real toolkit, which is far better exercised; CI gives Linux a // display with xvfb. tasks.withType(Test) { + // A widget or content link would otherwise be handed to the real system browser while tests run. systemProperty 'java.awt.headless', 'true' // One JVM per test class. JavaFX cannot be restarted inside a process, so every class that needs @@ -34,19 +35,9 @@ tasks.withType(Test) { systemProperty 'countly.ui.scenarioWithinApp', System.getProperty('countly.ui.scenarioWithinApp', 'false') } -dependencies { - // Load publish plugin ONLY when publish task is requested - if (gradle.startParameter.taskNames.any { it.toLowerCase().contains("publish") }) { - // This requires minimum java 11 to work - classpath 'com.vanniktech:gradle-maven-publish-plugin:0.28.0' - } - } -} +// The maven publish plugin is put on the classpath by the root build.gradle, so that every module +// shares one copy of it. -plugins { - id 'java-library' - id 'org.openjfx.javafxplugin' version '0.1.0' -} // Java 17, not 11. JavaFX only gained a public API for a transparent web view background // (WebView.setPageFill) in version 20, and JavaFX 20+ requires Java 17. Without it the only diff --git a/sdk-java/build.gradle b/sdk-java/build.gradle index 548d07ee..365bf075 100644 --- a/sdk-java/build.gradle +++ b/sdk-java/build.gradle @@ -2,19 +2,8 @@ apply plugin: 'java-library' // apply plugin: 'maven' -buildscript { - repositories { - mavenCentral() - //mavenLocal() - } - dependencies { - // Load publish plugin ONLY when publish task is requested - if (gradle.startParameter.taskNames.any { it.toLowerCase().contains("publish") }) { - // This requires minimum java 11 to work - classpath 'com.vanniktech:gradle-maven-publish-plugin:0.28.0' - } - } -} +// The maven publish plugin is put on the classpath by the root build.gradle, so that every module +// shares one copy of it. java { sourceCompatibility = JavaVersion.VERSION_1_8