-
Notifications
You must be signed in to change notification settings - Fork 456
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added search highlight in response tab. #71
base: master
Are you sure you want to change the base?
Added search highlight in response tab. #71
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some changes could be done, but this feature can really add to the lib.
library/src/main/java/com/readystatesoftware/chuck/internal/support/SearchHighlightUtil.java
Outdated
Show resolved
Hide resolved
public boolean onQueryTextChange(String newText) { | ||
String text = body.getText().toString(); | ||
if (newText.trim().length() > 0 && text.contains(newText.trim())) | ||
body.setText(SearchHighlightUtil.format(body.getText().toString(), newText)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should originalBody
here, no ?
body.setText(SearchHighlightUtil.format(originalBody, newText));
@@ -38,8 +43,10 @@ | |||
TextView headers; | |||
TextView body; | |||
|
|||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you add this line?
private int type; | ||
private HttpTransaction transaction; | ||
private String originalBody; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can maybe delete this field, and use transaction.getFormattedRequestBody()
instead. No need to add a field if another field already holds the value.
* Created by waleed on 17/02/2018. | ||
*/ | ||
|
||
public class SearchHighlightUtil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not a valid Javadoc. Take advantage of this fix for adding description to this new class.
Thank you for the detailed code review. I will do fixes and update the request. |
Hi,
I added a search functionality in the response tab. Now anyone can see highlighted search criteria on response tab.