Highlight instances in Android search results (with data sliding and automatic refresh at the bottom)

First, the renderings of

Search results (here I just simulate the data, and the returned data should contain keywords when it is really running with the server)

Simulated interface without search results

Concrete implementation

I'd like to add a word here, which is to do one thing and split it into multiple summaries, so as not to be confused during development, but also to control the progress of development

The idea is actually very simple. We monitor the changes in the input box, then request the server after the text changes, and then get the results we need for data display

Step 1: monitor the search box

Step 2: make relevant logical requests

Step 3: change color

Demo description

The local JSON here is artificially defined by me, and I added my own logic during the search. If it needs to be changed according to my own needs in the actual project, I don't need to care about the relevant display. Here is just an idea to realize the search and highlight the keywords.

Demo code portal: https://github.com/wuyinlei/SearchViewDemo

Download address: searchviewdemo_ jb51.rar

The above is the whole content of this article. I hope it will be helpful to your study, and I hope you can support programming tips.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>