lupidan / popoverview Goto Github PK
View Code? Open in Web Editor NEWA Popover Controller for Android Tablets. It's an easy solution to simulate an iOS UIPopoverController
License: GNU Lesser General Public License v3.0
A Popover Controller for Android Tablets. It's an easy solution to simulate an iOS UIPopoverController
License: GNU Lesser General Public License v3.0
If we use any arrow instead of default arrow, arrow is coming on popup.
I got few doubts:
I got IllegalStateException on line 307( popoverview,java), when I tried to attach a view to popover view inside the popoverview.java class.
Also when we add characters it's working fine on tablets, but when it comes to phones, its get truncated. Is there any method like wrap content, provided by android?
This should be handled inside the library or is it open to developer for handling that scebnario. Everything excepts works fine for this library.
java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.
I am showing a text content for different language in popover view. for English the size I set is ok, but for other languages the text are truncated
Is there any option to set the width and heigh like wrap_content
hey, previous issue solved, thank you for your hint,
I have a new problem, I'm using the popover to pop after a selection on a webview is made. When I load the html on the webview I scroll through it horizontally, when the pop over is used to pop on the first page there's no problem and the popover position is exactly where I clicked, but the problem is that when I scroll to another, the popover still pops on the first page of the webview.
would you kindly look into it and let me know what I'm doing wrong.
Thank u.
I am many textview in popover view. But i am not able to get click event on textview.
I did get any idea to how to get click event on textview which was in popover view.
Thanks in advance.
I would like to thank you for this solution, it is very helpful. I'm trying to integrate this solution in my project, but I'm still new to android, what I'm trying to do is to run the following function from the webview class I have, and its triggered by a button. The problem is when it reaches popoverView.showPopoverFromRectInViewGroup it gives WebViewCoreThread fatal exception. android.view.ViewRootImpl$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.
NB: I have changed the textWebView in popover_showed_view into a webview cause I have html content to show.
public void openPopOverWithContent(String content, Rect displayR)
{
PopoverView popoverView = new PopoverView(context, R.layout.popover_showed_view);
popoverView.setContentSizeForViewInPopover(new Point(320, 340));
popoverView.setDelegate(this);
myWebView.getSettings().setJavaScriptEnabled(true);
myWebView.loadDataWithBaseURL(null, "hello", "text/html", "utf-8", null);
Rect viewRect = new Rect(300, 300, 300, 320);
popoverView.showPopoverFromRectInViewGroup(this, viewRect, PopoverView.PopoverArrowDirectionAny, true);
}
Thanx in advance
is this possible - ViewPager with multiple fragments within the popoverview? pretty much this example in a popover, nothing more complex than this.
http://developer.android.com/training/animation/screen-slide.html
I have tried to take the example and add to the popoverview. unsuccessful. still a bit new to android. how would i go about doing this?
this would be a great addition to the popoverview
thanks and keep up the good work :)
Hy,
I have defined in my popover view a button and defined a click handler for it.
The click handler does not trigger.
RelativeLayout rootView = (RelativeLayout)findViewById(R.id.rootLayout);
PopoverView popoverView = new PopoverView(this, R.layout.popover_showed_view);
popoverView.setContentSizeForViewInPopover(new Point(320, 340));
popoverView.setDelegate(this);
View popoverViewReference = getLayoutInflater().inflate(R.layout.popover_showed_view, null);
if( popoverViewReference != null)
{
btn_popoverSearch = (Button) popoverViewReference.findViewById(R.id.btn_test);
btn_popoverSearch.setOnClickListener(new OnClickListener()
{
@Override
public void onClick(View v)
{
//handler code here
}
});
popoverView.showPopoverFromRectInViewGroup(rootView, PopoverView.getFrameForView(v), PopoverView.PopoverArrowDirectionAny, true);
}
The btn_popoverSearch is found and is not null but the event handler is not called.
Any suggestions? Thanks a lot.
is that possible change the frame of popoverView ?
if the popover view is a list view, how can I know which one is selected in delegate?
It's better to support fragment so we can go to other views in the popover view ( similar like UINavigationController in popover)
My apologies for being a little vague in this first question, but I am not very far along.
I would like to display the PopoverView from an ActionBar MenuItem, and am not getting the desired results. I am using the ActionBarSherlock library.
Here is a snippet of code where I am attempting to set up the PopoverView.
@Override
public boolean onOptionsItemSelected(MenuItem item) {
if (item.getItemId() == android.R.id.home) {
//...
} else if (item.getItemId() == R.id.action_notifications) {
PopoverView popoverView = new PopoverView(this, R.layout.popover_notifications_view);
popoverView.setDelegate(this);
RelativeLayout rootView = (RelativeLayout)findViewById(R.id.rootLayout);
popoverView.setContentSizeForViewInPopover(new Point(640, 680));
View v = (View)findViewById(R.id.action_notifications);
popoverView.showPopoverFromRectInViewGroup(rootView, PopoverView.getFrameForView(v), PopoverView.PopoverArrowDirectionAny, true);
return(true);
}
return super.onOptionsItemSelected(item);
}
I feel like the view used for PopoverView.getFrameForView(v) is wrong. I'm trying to reference the globe item in the screenshot. I am getting the PopoverView underneath the ActionBar like this:
Any direction or sample would be very much appreciated.
Jeremy
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.