kakajika / relativepopupwindow Goto Github PK
View Code? Open in Web Editor NEWAndroid PopupWindow that can be easily located relative to anchor View.
License: MIT License
Android PopupWindow that can be easily located relative to anchor View.
License: MIT License
android:id="@+id/tv_pop_content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginTop="50dp"
android:background="@drawable/collect_tips"
android:gravity="center"
android:textColor="@android:color/white"
android:textSize="@dimen/sp13" />
public void showOnAnchor(@NonNull View anchor, @VerticalPosition int vertPos, @HorizontalPosition int horizPos, int x, int y, boolean fitInScreen) {
setClippingEnabled(fitInScreen);
View contentView = getContentView();
contentView.measure(makeDropDownMeasureSpec(getWidth()), makeDropDownMeasureSpec(getHeight()));
//i use the layout above ,and collect_tips is a .9 png.
//so,bug occurs,the measuredW is not the real width.
final int measuredW = contentView.getMeasuredWidth();
final int measuredH = contentView.getMeasuredHeight();
i use the layout above ,and collect_tips is a .9 png.
so,bug occurs,the measuredW is not the real width.
Similar to this:
It's not working on Android 5.1 .
Can u support more examples in difference language such as JAVA?
Could you please publish it again in mavenCentral? Thanks
when display height less than real height ,the measureHeight is wrong.
the code:
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_margin="8dp"
android:gravity="center"
android:minHeight="80dp"
android:minWidth="80dp"
android:orientation="vertical">
<TextView
style="?android:attr/textAppearanceLarge"
android:layout_width="wrap_content"
android:layout_height="80dp"
android:gravity="center"
android:text="Hello World"
/>
<TextView
style="?android:attr/textAppearanceLarge"
android:layout_width="wrap_content"
android:layout_height="80dp"
android:gravity="center"
android:text="Hello World"
/>
</LinearLayout>
popup.setHeight((int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 80, getResources().getDisplayMetrics()));
配置compile 'com.labo.kaji:relativepopupwindow:0.2.0' 之后,就报这个错了,你这个项目是不是一定要依赖支持包的
I've noticed that if you set RecyclerView views as anchors, and I click on one of the bottom ones of the screen, it doesn't get shown.
This is when I use WRAP_CONTENT for width and height of the popup.
If I try to set width and height myself, I've noticed that it sometimes scrolls the RecyclerView.
Attached video and sample project to show issues:
MyApplication.zip
2019-08-01_11-31-43.zip
Please fix those issues.
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.