Imita el efecto del cuadro de búsqueda bilibili (sólo se necesitan tres frases para lograrlo)
Primero eche un vistazo a la imagen de vista previa (hay una pequeña distorsión después de la conversión):
1. Admite historial de búsqueda (ya almacenado en la base de datos)
2. El efecto de búsqueda es básicamente el mismo que el de bilibili.
3. Si necesita modificar más contenido, puede descargar la biblioteca y modificarla usted mismo.
4. No soy un experto. Si hay algún problema, infórmelo a través de Problemas.
5. Gracias por consultar el artículo de este po.
6. Gracias por enviar problemas. Ha pasado tanto tiempo desde que actualicé. Lo siento por 8.
Con Gradle:
implementation ' com.wenwenwen888:searchbox:1.0.1 '
La primera oración, creación de instancias:
SearchFragment searchFragment = SearchFragment . newInstance ();
Segunda oración, configurar devolución de llamada:
searchFragment . setOnSearchClickListener ( new IOnSearchClickListener () {
@ Override
public void OnSearchClick ( String keyword ) {
//这里处理逻辑
Toast . makeText ( ToolBarActivity . this , keyword , Toast . LENGTH_SHORT ). show ();
}
});
La tercera oración, muestra el cuadro de búsqueda:
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.