A Popover Controller for Android Tablets. It's an easy solution to simulate an iOS UIPopoverController

Related tags

UI/UX PopoverView
Overview

PopoverView

A Popover Controller for Android Tablets. It's an easy solution to simulate an iOS UIPopoverController Base example 9patch image comes from http://android9patch.blogspot.com.es/ :)

Showing a popover controller is as easy as this

//get root layout
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);
popoverView.showPopoverFromRectInViewGroup(rootView, PopoverView.getFrameForView(v), PopoverView.PopoverArrowDirectionAny, true);

You can set more things as well, such as the drawable arrows or the drawable background of the popover view, as well as the fade time It also has an interface to notice when the popover appears or dismiss.

Screenshot 1 Screenshot 2 Screenshot 3

Comments
  • Button Event handler in popover not working

    Button Event handler in popover not working

    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.

    opened by flaviusdemian 4
  • ViewPager in popoverview

    ViewPager in popoverview

    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 :)

    opened by aperritano 4
  • WebViewCoreThread fatal exception

    WebViewCoreThread fatal exception

    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

    opened by coder4567 4
  • popover position

    popover position

    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.

    opened by coder4567 2
  • PopoverView from an ActionBar MenuItem

    PopoverView from an ActionBar MenuItem

    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:

    screenshot_2014-01-09-10-48-45

    Any direction or sample would be very much appreciated. Jeremy

    opened by jeremymedford 1
  • How to set click event on textview in popover

    How to set click event on textview in popover

    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.

    opened by kantilalrathod 0
  • IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first

    IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first

    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.

    opened by SanalVarghese 0
  • Is there any option to set the width and heigh like wrap_content

    Is there any option to set the width and heigh like wrap_content

    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

    opened by Thamizhan 2
Owner
Daniel Lupiañez Casares
Daniel Lupiañez Casares
Android View that displays different content based on its state

MultiStateView Android View that displays different content based on its state. Based off of MeetMe/MultiStateView The four different states the view

Kenny 1.2k Dec 16, 2022
An Android library supports badge notification like iOS in Samsung, LG, Sony and HTC launchers.

ShortcutBadger: The ShortcutBadger makes your Android App show the count of unread messages as a badge on your App shortcut! Supported launchers: Sony

Leo Lin 7.2k Dec 30, 2022
ios UISegmentedControl for android

android-segmented-control Android-Segmented is a custom view for Android which is based on RadioGroup and RadioButton widget. This implementation is i

Kaopiz Software Co., Ltd. 1.9k Dec 12, 2022
ios UISegmentedControl for android

android-segmented-control Android-Segmented is a custom view for Android which is based on RadioGroup and RadioButton widget. This implementation is i

Kaopiz Software Co., Ltd. 1.9k Dec 12, 2022
iOS UIActionSheet for Android

ActionSheet This is like iOS UIActionSheet component, has iOS6 and iOS7 style, support custom style, background, button image, text color and spacing

星一 810 Nov 10, 2022
A realtime blurring overlay for Android (like iOS UIVisualEffectView)

RealtimeBlurView It's just a realtime blurring overlay like iOS UIVisualEffectView. Just put the view in the layout xml, no Java code is required. //

Tu Yimin 3k Jan 9, 2023
Simple and powerful library to emulate iOS's "3D Touch" preview functionality on Android.

Android 3D Touch - PeekView iOS uses 3D Touch as a way to "peek" into full content, such as emails, pictures, web searches, etc. While they have dedic

Luke Klinker 502 Dec 29, 2022
Multiplatform UI DSL with screen management in common code for mobile (android & ios) Kotlin Multiplatform development

Mobile Kotlin widgets This is a Kotlin MultiPlatform library that provides declarative UI and application screens management in common code. You can i

IceRock Development 320 Dec 30, 2022
A Jetpack Compose library with blur, pixelate, and other effects to keep your designer happy. Inspired by iOS UIVisualEffectView.

A Jetpack Compose library with blur, pixelate, and other effects to keep your designer happy. Inspired by iOS UIVisualEffectView.

清茶 67 Dec 30, 2022
TourGuide is an Android library that aims to provide an easy way to add pointers with animations over a desired Android View

TourGuide TourGuide is an Android library. It lets you add pointer, overlay and tooltip easily, guiding users on how to use your app. Refer to the exa

Tan Jun Rong 2.6k Jan 5, 2023
⚡️A highly customizable, powerful and easy-to-use alerting library for Android.

Flashbar A highly customizable, powerful and easy-to-use alerting library for Android. Specs This library allows you to show messages or alerts in you

Aritra Roy 1.7k Dec 7, 2022
A simple, customizable and easy to use swipeable view stack for Android.

SwipeStack A simple, customizable and easy to use swipeable view stack for Android. QuickStart Include the Gradle dependency dependencies { compil

Frederik Schweiger 1.5k Dec 30, 2022
A small, easy to use android library for implementing flipping between views as seen in the popular Flipboard application

FlipView About This library is made to be very easy to use and at the same time be feature complete. With only a few lines of code you can have a flip

Emil Sjölander 924 Nov 10, 2022
The CustomCalendarView provides an easy and customizable calendar to create a Calendar. It dispaly the days of a month in a grid layout and allows to navigate between months

Custom-Calendar-View To use the CustomCalendarView in your application, you first need to add the library to your application. You can do this by eith

Nilanchala Panigrahy 113 Nov 29, 2022
💳 A quick and easy flip view through which you can create views with two sides like credit cards, poker cards etc.

The article on how this library was created is now published. You can read it on this link here. →. ?? EasyFlipView Built with ❤︎ by Wajahat Karim and

Wajahat Karim 1.3k Dec 14, 2022
Just a Wheel——A easy way to setEmptyView to ListView、GridView or RecyclerView etc..

中文说明在这里 TEmptyView Just a Wheel—— A easier way to setEmptyView. Without having to write xml file every time. It supports AdapterView(ListView,GridView

Barry 454 Jan 9, 2023
Android library used to create an awesome Android UI based on a draggable element similar to the last YouTube graphic component.

Draggable Panel DEPRECATED. This project is not maintained anymore. Draggable Panel is an Android library created to build a draggable user interface

Pedro Vicente Gómez Sánchez 3k Dec 6, 2022
Bubbles for Android is an Android library to provide chat heads capabilities on your apps. With a fast way to integrate with your development.

Bubbles for Android Bubbles for Android is an Android library to provide chat heads capabilities on your apps. With a fast way to integrate with your

Txus Ballesteros 1.5k Jan 2, 2023
View that imitates Ripple Effect on click which was introduced in Android L (for Android 2.3+)

RippleView View that imitates Ripple Effect on click which was introduced in Android L. Usage For a working implementation, Have a look at the Sample

Muthuramakrishnan Viswanathan 1.2k Dec 30, 2022