@@ -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 })
0 commit comments