Skip to content

Commit e5d6574

Browse files
authored
Merge pull request #10 from FastComments/comment-ui-v2
New Comment Form UI
2 parents 607ec5e + 1691a7e commit e5d6574

File tree

10 files changed

+949
-394
lines changed

10 files changed

+949
-394
lines changed

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

Lines changed: 505 additions & 0 deletions
Large diffs are not rendered by default.

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

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -151,25 +151,24 @@ private boolean shouldInterceptBackPress() {
151151
return false;
152152
}
153153

154-
// Get the comment form from CommentsView
155-
CommentFormView commentForm = commentsView.getCommentForm();
156-
if (commentForm == null) {
154+
// Get the bottom comment input from CommentsView
155+
BottomCommentInputView bottomInput = commentsView.getBottomCommentInput();
156+
if (bottomInput == null) {
157157
return false;
158158
}
159159

160-
// Check if the form is visible and has text
161-
boolean formVisible = commentsView.isCommentFormVisible();
162-
boolean hasText = !commentForm.isTextEmpty();
160+
// Check if user has typed any text (either in reply or new comment)
161+
boolean hasText = !bottomInput.isTextEmpty();
163162

164-
return formVisible && hasText;
163+
return hasText;
165164
}
166165

167166
@Override
168167
public void onBackPressed() {
169168
if (shouldInterceptBackPress()) {
170-
// Get the comment form and check if it has a parent comment (reply) or text
171-
CommentFormView commentForm = commentsView.getCommentForm();
172-
RenderableComment parentComment = commentForm.getParentComment();
169+
// Get the bottom input and check if it has a parent comment (reply) or text
170+
BottomCommentInputView bottomInput = commentsView.getBottomCommentInput();
171+
RenderableComment parentComment = bottomInput.getParentComment();
173172

174173
// Show confirmation dialog
175174
String title, message;
@@ -186,8 +185,8 @@ public void onBackPressed() {
186185
.setMessage(message)
187186
.setPositiveButton(android.R.string.yes, (dialog, which) -> {
188187
// Proceed with cancellation
189-
commentsView.hideCommentForm();
190-
commentForm.resetReplyState();
188+
bottomInput.clearReplyState();
189+
bottomInput.clearText();
191190

192191
// Don't dismiss the dialog yet - let the user continue with comments
193192
})

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1136,7 +1136,8 @@ public void searchUsers(String searchTerm, final FCCallback<List<UserMention>> c
11361136
callback.onSuccess(new ArrayList<>());
11371137
return;
11381138
}
1139-
1139+
Log.i("FastCommentsSDK", "Searching for users: " + searchTerm);
1140+
11401141
try {
11411142
// Create the search users request with the proper parameters
11421143
api.searchUsers(config.tenantId, config.urlId, searchTerm)

0 commit comments

Comments
 (0)