Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
19 changes: 12 additions & 7 deletions sdk-java-ui/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.

Expand Down
25 changes: 8 additions & 17 deletions sdk-java-ui/build.gradle
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
15 changes: 2 additions & 13 deletions sdk-java/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading