Skip to content

Commit 28622e9

Browse files
committed
Fixes NPE and input placement issue with live chat
1 parent 49b3de1 commit 28622e9

File tree

3 files changed

+5
-17
lines changed

3 files changed

+5
-17
lines changed

app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
android:name=".LiveChatExampleActivity"
6060
android:exported="true"
6161
android:label="FastComments Live Chat"
62+
android:windowSoftInputMode="adjustResize"
6263
android:theme="@style/Theme.AppCompat.Light.NoActionBar">
6364
<intent-filter>
6465
<action android:name="android.intent.action.MAIN" />

app/src/main/java/com/fastcomments/LiveChatExampleActivity.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class LiveChatExampleActivity : AppCompatActivity() {
3737
);
3838
val sso = FastCommentsSSO(userData)
3939
config.sso = sso.prepareToSend()
40-
sdk = FastCommentsSDK().configure(config)
40+
sdk = FastCommentsSDK(config)
4141

4242
// Find the live chat view in the layout
4343
liveChatView = findViewById(R.id.liveChatView)

libraries/sdk/src/main/java/com/fastcomments/sdk/FastCommentsSDK.java

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
import android.os.Looper;
66
import android.util.Log;
77

8+
import androidx.annotation.NonNull;
9+
810
import com.fastcomments.api.PublicApi;
911
import com.fastcomments.core.CommentWidgetConfig;
1012
import com.fastcomments.invoker.ApiCallback;
@@ -56,7 +58,7 @@ public class FastCommentsSDK {
5658
private String userIdWS;
5759
private String editKey;
5860

59-
public FastCommentsSDK(CommentWidgetConfig config) {
61+
public FastCommentsSDK(@NonNull CommentWidgetConfig config) {
6062
this.api = new PublicApi();
6163
this.mainHandler = new Handler(Looper.getMainLooper());
6264
this.broadcastIdsSent = new HashSet<>(0);
@@ -72,28 +74,13 @@ public FastCommentsSDK(CommentWidgetConfig config) {
7274
this.commentsTree.setPresenceStatusListener(this::fetchPresenceForUsers);
7375
}
7476

75-
public FastCommentsSDK() {
76-
this(null);
77-
}
78-
7977
public static String getAPIBasePath(CommentWidgetConfig config) {
8078
if (Objects.equals(config.region, "eu")) {
8179
return "https://eu.fastcomments.com";
8280
}
8381
return "https://fastcomments.com";
8482
}
8583

86-
/**
87-
* Configure the SDK with widget configuration
88-
*
89-
* @param config CommentWidgetConfig object
90-
* @return FastCommentsSDK instance for chaining
91-
*/
92-
public FastCommentsSDK configure(CommentWidgetConfig config) {
93-
this.config = config;
94-
return this;
95-
}
96-
9784
/**
9885
* Get the current widget configuration
9986
*

0 commit comments

Comments
 (0)