wenwenwen888 / searchdialog Goto Github PK
View Code? Open in Web Editor NEW仿bilibili搜索框效果(三句代码实现)
仿bilibili搜索框效果(三句代码实现)
it will toggle multiply the IOnSearchClickListener.OnSearchClick(String str) if you try click many times fastly cancelbutton or each itemview keywords of searchHistoryAdapter as possible as you can, it is a suggestion can get over it :
private long lastClickTime;
/**
* judge there is mulitclick's action between last click time and now's time
*/
public boolean isFastDoubleClick() {
long time = System.currentTimeMillis();
long timeD = time - lastClickTime;
if (0 < timeD && timeD < 500) { // this number isn't must be valued 500,just insteal your animation's duration
return true;
}
lastClickTime = time;
return false;
}
And use it in functions of OnItemClick() and hideAnim()
Maybe you already found this issues, this is my gratitude for your SearchFragment ! ↖(^ω^)↗
控件写的非常的棒,但是提一个小的意见,请把语言全部放到steings.xml里面,这样我不需要下载代码存放本地就可以修改语言
我的页面继承是的Activity.所以报错,找不到getSupportFragmentManager()这个方法,怎么解决呢?
关闭后再调用
searchFragment.show(getSupportFragmentManager(),SearchFragment.TAG);
..多次后会有残余动画,上一帧显示..然后再消失
搜索页打开的时候焦点不在edittext,这个时候输入无效,需要点击searchView的EditText才能正确获取焦点
1、历史记录的数量可以进行限制,保存最新的N条搜索记录。
2、历史记录目前只能竖直排列,可以考虑新增横向排列,这样显示的数量就能多一些。类似哔哩哔哩。
3、app里面有多个页面的搜索,但是页面内容不是同一类东西。能不能分别保存和读取他们的搜索记录。比如目前我在班级搜索页面进行搜索,会提示之前在学生搜索页面搜索的学生名字。
1、历史记录的数量可以进行限制,保存最新的N条搜索记录。
2、历史记录目前只能竖直排列,可以考虑新增横向排列,这样显示的数量就能多一些。类似哔哩哔哩。
3、app里面有多个页面的搜索,但是页面内容不是同一类东西。能不能分别保存和读取他们的搜索记录。比如目前我在班级搜索页面进行搜索,会提示之前在学生搜索页面搜索的学生名字。
如题
打开搜索框 后关闭会发生泄漏。
我没看到反射代码
用surfaceView 就更好了
searchFragment.showFragment(getSupportFragmentManager(), SearchFragment.TAG);
请问这句话报错空指针怎么解决
java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState
at android.support.v4.app.FragmentManagerImpl.checkStateLoss(FragmentManager.java)
at android.support.v4.app.FragmentManagerImpl.enqueueAction(FragmentManager.java)
at android.support.v4.app.BackStackRecord.commitInternal(BackStackRecord.java)
at android.support.v4.app.BackStackRecord.commit(BackStackRecord.java)
at android.support.v4.app.DialogFragment.dismissInternal(DialogFragment.java)
at android.support.v4.app.DialogFragment.dismiss(DialogFragment.java)
at com.wyt.searchbox.SearchFragment.onHideAnimationEnd(SearchFragment.java)
at com.wyt.searchbox.custom.CircularRevealAnim$1.onAnimationEnd(CircularRevealAnim.java)
at android.view.RenderNodeAnimator.onFinished(RenderNodeAnimator.java:376)
at android.animation.RevealAnimator.onFinished(RevealAnimator.java:43)
at android.view.RenderNodeAnimator.callOnFinished(RenderNodeAnimator.java:483)
at android.os.MessageQueue.nativePollOnce(Native Method)
at android.os.MessageQueue.next(MessageQueue.java:153)
at android.os.Looper.loop(Looper.java:178)
at android.app.ActivityThread.main(ActivityThread.java:5911)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1113)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:879)
整体的效果很棒。但是还是有几个小问题:
1.搜索记录应该过滤掉重复的数据,比如我一直重复搜索相同的内容,记录里会一直存相同的,正常应该只显示一个。
2.能开放一下最多保存几条数据的方法就好了,因为现在有很多项目会限制显示记录的条数。
项目还在维护么 能适配一下 appt2 么 如果还在维护希望您能回复
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.