Imite o efeito da caixa de pesquisa bilibili (são necessárias apenas três frases para alcançá-lo)
Dê uma olhada na imagem de visualização primeiro (há uma pequena distorção após a conversão):
1. Suporte ao histórico de pesquisa (já armazenado no banco de dados)
2. O efeito de pesquisa é basicamente o mesmo do bilibili.
3. Se precisar modificar mais conteúdo, você pode baixar a biblioteca e modificá-la você mesmo.
4. Não sou um especialista. Se houver algo errado, aponte em Problemas. Obrigado.
5. Obrigado por consultar o artigo deste po.
6. Obrigado por enviar problemas. Já faz muito tempo que não atualizei. Sinto muito por 8.
Com Gradle:
implementation ' com.wenwenwen888:searchbox:1.0.1 '
A primeira frase, instanciação:
SearchFragment searchFragment = SearchFragment . newInstance ();
Segunda frase, defina o retorno de chamada:
searchFragment . setOnSearchClickListener ( new IOnSearchClickListener () {
@ Override
public void OnSearchClick ( String keyword ) {
//这里处理逻辑
Toast . makeText ( ToolBarActivity . this , keyword , Toast . LENGTH_SHORT ). show ();
}
});
A terceira frase, exibe a caixa de pesquisa:
searchFragment . showFragment ( getSupportFragmentManager (), SearchFragment . TAG );
Copyright 2016 wenwenwen888
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.