Skip to content
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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

Hafiz-Waleed-Hussain
Copy link

Hi,
I added a search functionality in the response tab. Now anyone can see highlighted search criteria on response tab.

Copy link

@olivierperez olivierperez left a 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.

build.gradle Outdated Show resolved Hide resolved
library/src/main/res/menu/chuck_transaction.xml 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));

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;


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;

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 {

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.

@Hafiz-Waleed-Hussain
Copy link
Author

Thank you for the detailed code review. I will do fixes and update the request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants