File tree Expand file tree Collapse file tree 5 files changed +29
-10
lines changed
src/main/java/com/saasquatch/android Expand file tree Collapse file tree 5 files changed +29
-10
lines changed Original file line number Diff line number Diff line change 2
2
3
3
## [ Unreleased]
4
4
5
+ ## [ 0.1.1] - 2025-06-12
6
+
7
+ ### Changed
8
+
9
+ - Added base URL for WebView.
10
+ - Internal dependency version bumps.
11
+
5
12
## [ 0.1.0] - 2024-11-22
6
13
7
14
### Changed
67
74
68
75
## [ 0.0.1] - 2021-02-17
69
76
70
- [ Unreleased ] : https://github.com/saasquatch/squatch-android/compare/0.1.0...HEAD
77
+ [ Unreleased ] : https://github.com/saasquatch/squatch-android/compare/0.1.1...HEAD
78
+
79
+ [ 0.1.1 ] : https://github.com/saasquatch/squatch-android/compare/0.1.0...0.1.1
71
80
72
81
[ 0.1.0 ] : https://github.com/saasquatch/squatch-android/compare/0.0.9...0.1.0
73
82
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ Add the dependency:
24
24
25
25
``` gradle
26
26
dependencies {
27
- implementation 'com.github.saasquatch:squatch-android:0.1.0 '
27
+ implementation 'com.github.saasquatch:squatch-android:0.1.1 '
28
28
}
29
29
```
30
30
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ dependencies {
27
27
androidTestImplementation ' androidx.test.espresso:espresso-core:3.5.1'
28
28
api ' com.github.saasquatch:saasquatch-java-sdk:0.2.0'
29
29
api ' org.reactivestreams:reactive-streams:1.0.4'
30
- implementation ' io.reactivex.rxjava3:rxjava:3.1.9 '
30
+ implementation ' io.reactivex.rxjava3:rxjava:3.1.10 '
31
31
implementation ' io.reactivex.rxjava3:rxandroid:3.0.2'
32
32
implementation ' com.google.code.findbugs:jsr305:3.0.2'
33
33
}
Original file line number Diff line number Diff line change 1
1
package com .saasquatch .android ;
2
2
3
- import static java .nio .charset .StandardCharsets .UTF_8 ;
4
-
5
3
import android .annotation .SuppressLint ;
6
- import android .util .Base64 ;
7
4
import android .webkit .WebSettings ;
8
5
import android .webkit .WebView ;
9
6
import com .saasquatch .android .input .AndroidRenderWidgetOptions ;
@@ -125,8 +122,8 @@ private void loadHtmlToWebView(@Nonnull AndroidRenderWidgetOptions androidRender
125
122
webSettings .setJavaScriptEnabled (true );
126
123
webSettings .setDomStorageEnabled (true );
127
124
SquatchJavascriptInterface .applyToWebView (webView );
128
- final String htmlBase64 = Base64 . encodeToString ( htmlString . getBytes ( UTF_8 ), Base64 . DEFAULT );
129
- webView . loadData ( htmlBase64 , "text/html; charset=utf-8" , "base64" );
125
+ webView . loadDataWithBaseURL ( androidRenderWidgetOptions . getWebViewBaseUrl ( ), htmlString ,
126
+ "text/html; charset=utf-8" , null , null );
130
127
}
131
128
132
129
private void loadErrorHtmlToWebView (
Original file line number Diff line number Diff line change 7
7
public final class AndroidRenderWidgetOptions {
8
8
9
9
private final WebView webView ;
10
+ private final String webViewBaseUrl ;
10
11
11
- private AndroidRenderWidgetOptions (WebView webView ) {
12
+ private AndroidRenderWidgetOptions (WebView webView , String webViewBaseUrl ) {
12
13
this .webView = webView ;
14
+ this .webViewBaseUrl = webViewBaseUrl ;
13
15
}
14
16
15
17
public WebView getWebView () {
16
18
return webView ;
17
19
}
18
20
21
+ public String getWebViewBaseUrl () {
22
+ return webViewBaseUrl ;
23
+ }
24
+
19
25
public static Builder newBuilder () {
20
26
return new Builder ();
21
27
}
@@ -27,6 +33,7 @@ public static AndroidRenderWidgetOptions ofWebView(@Nonnull WebView webView) {
27
33
public static final class Builder {
28
34
29
35
private WebView webView ;
36
+ private String webViewBaseUrl = "https://fast.ssqt.io/" ;
30
37
31
38
private Builder () {}
32
39
@@ -35,8 +42,14 @@ public Builder setWebView(@Nonnull WebView webView) {
35
42
return this ;
36
43
}
37
44
45
+ public Builder setWebViewBaseUrl (String webViewBaseUrl ) {
46
+ this .webViewBaseUrl = webViewBaseUrl ;
47
+ return this ;
48
+ }
49
+
38
50
public AndroidRenderWidgetOptions build () {
39
- return new AndroidRenderWidgetOptions (Objects .requireNonNull (webView , "webView" ));
51
+ return new AndroidRenderWidgetOptions (Objects .requireNonNull (webView , "webView" ),
52
+ webViewBaseUrl );
40
53
}
41
54
42
55
}
You can’t perform that action at this time.
0 commit comments