SearchDialog
1.0.0
bilibili の検索ボックス効果を模倣します (これを達成するには 3 つの文だけが必要です)
まずプレビュー画像を見てください (変換後は多少の歪みがあります)。
1. 検索履歴のサポート (データベースに保存済み)
2. 検索効果は基本的にbilibiliと同じです。
3. さらにコンテンツを変更する必要がある場合は、ライブラリをダウンロードして自分で変更できます。
4. 私は専門家ではありません。何か間違っている場合は、問題点を通じて指摘してください。
5. この記事を参考にしていただきありがとうございます。
6. 問題を送信していただきありがとうございます。8 を更新するのはかなり久しぶりです。
グラドルの場合:
implementation ' com.wenwenwen888:searchbox:1.0.1 '
最初の文、インスタンス化:
SearchFragment searchFragment = SearchFragment . newInstance ();
2 番目の文、コールバックの設定:
searchFragment . setOnSearchClickListener ( new IOnSearchClickListener () {
@ Override
public void OnSearchClick ( String keyword ) {
//这里处理逻辑
Toast . makeText ( ToolBarActivity . this , keyword , Toast . LENGTH_SHORT ). show ();
}
});
3 番目の文では、検索ボックスを表示します。
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.