jiang111 / indicatordialog Goto Github PK
View Code? Open in Web Editor NEWa dialog with arrow indicator in the location where you want
a dialog with arrow indicator in the location where you want
使用.width()设置宽度后,在不同屏幕上,显示效果不同,建议使用dp
原来代码:
recyclerView.getViewTreeObserver().addOnGlobalLayoutListener(new
ViewTreeObserver.OnGlobalLayoutListener() {
@RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN)
@OverRide
public void onGlobalLayout() {
recyclerView.getViewTreeObserver().removeOnGlobalLayoutListener(this);
int recyclerviewHeight = recyclerView.getHeight();
resizeHeight(recyclerviewHeight);
}
}); 以上代码在Android4.2以下Android设备会崩溃,建议修改为以下代码:
recyclerView.getViewTreeObserver().addOnGlobalLayoutListener(newViewTreeObserver.OnGlobalLayoutListener() { @RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN) @Override public void onGlobalLayout() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { recyclerView.getViewTreeObserver().removeOnGlobalLayoutListener(this); } else { recyclerView.getViewTreeObserver().removeGlobalOnLayoutListener(this); } int recyclerviewHeight = recyclerView.getHeight(); resizeHeight(recyclerviewHeight); } });
博主你好!
当项目运行起来的时候,点击dialog中的不同的item的时候,通过v.getId()是不会变的,是否有误?
public void onItemClick(View v, int position) {
Toast.makeText(mContext,"点击了"+position+"=="+v.getId(),Toast.LENGTH_SHORT).show();
}
详见上面的弹出的toast!
Error:Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed : uses-sdk:minSdkVersion 14 cannot be smaller than version 15 declared in library [com.github.jiang111:IndicatorDialog:v1.3.8] D:\Users\ange\.gradle\caches\transforms-1\files-1.1\IndicatorDialog-v1.3.8.aar\1f883e4a320c0293434aef97bc6129d5\AndroidManifest.xml as the library might be using APIs not available in 14
Suggestion: use a compatible library with a minSdk of at most 14,
or increase this project's minSdk version to at least 15,
or use tools:overrideLibrary="com.jiang.android.indicatordialog" to force usage (may lead to runtime failures)
博主!您好,看了您写的非常不错的文章,心中有个疑惑?就是RecyclerView的中的每个item的点击事件是怎么获取的,貌似没有看懂?还请指教!
demo中toolbar为止的弹出框垂直位置偏移过大,而且顶部还有一根横线
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.