popupwindow

How to show PopupWindow at special location?

做~自己de王妃 提交于 2019-11-27 06:12:52
I need to show PopupWindow under one Views shown on the screen. How can I calculate coordinates of needed View and place PopupWindow under it? Code example are more than welcome. Thanks. Locating an already displayed view is fairly easy - here's what I use in my code: public static Rect locateView(View v) { int[] loc_int = new int[2]; if (v == null) return null; try { v.getLocationOnScreen(loc_int); } catch (NullPointerException npe) { //Happens when the view doesn't exist on screen anymore. return null; } Rect location = new Rect(); location.left = loc_int[0]; location.top = loc_int[1];

Add a UIView above all, even the navigation bar

我只是一个虾纸丫 提交于 2019-11-27 02:35:40
I want to display, above any other views, even the navigation bar, a kind of "pop-up" view that looks like this: full screen black background with a 0.5 alpha to see the other UIViewController underneath. a UIView window in the middle with some information, (a calendar if you want to know everything). To do that, I've created a UIViewController that contains the two UIViews (background and window), and I'm trying to display it. I've tried a simple [mySuperVC addSubview:myPopUpVC.view] , but I still have the navigation bar above. I've tried to present it as a modal, but the UIViewController

Popupwindow with image

泪湿孤枕 提交于 2019-11-27 01:41:16
问题 I need to be able to click an imgview in a listview , which should open a popup showing the image fullsize. I've managed to implement the clicklistener , but keep failing at creating the popup, even with just a testing textview . In my mainActivity oncreate i run lstView.setAdapter(new CustomListViewAdapter(this, dataFromDBListe, 0, orientation)); In my CustomListVievAdapter, where i have my clicklistener (which can display a toast at the moment) I have the following getView() : public View

How to make Twitter app style Quick Actions on Android

佐手、 提交于 2019-11-27 01:33:11
问题 Is there any code that gives an example about how to implement the Quick Actions and Popdown menu that is displayed in the Twitter for Android app? 回答1: Funny you should ask that as I just have happened to finish working on this exact thing. You can check out the code here simple quickactions for android 来源: https://stackoverflow.com/questions/3113106/how-to-make-twitter-app-style-quick-actions-on-android

ViewPager with Fragments inside PopupWindow (or DialogFragment) - Error no view found for id for fragment

六眼飞鱼酱① 提交于 2019-11-27 01:03:55
问题 I created a FragmentActivity with this code below public class Activity_principal1 extends FragmentActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_principal1); List<Fragment> fragments = getFragments(); AcoesMuscularesAdapter ama = new AcoesMuscularesAdapter(getSupportFragmentManager(), fragments); ViewPager vp_contentAcoesMusculares_SequenciaExercicios = (ViewPager) findViewById(R.id.vp

Can android PopupWindow show another PopupWindow?

妖精的绣舞 提交于 2019-11-26 23:21:08
问题 Can android PopupWindow show another PopupWindow? How many PopupWindow can be opened in the same time? Only one? The first PopupWindow is displayed normally. But on button click (which is in the first PopupWindow contentview) i am having an exception: 08-13 16:28:38.682: ERROR/AndroidRuntime(11760): FATAL EXCEPTION: main android.view.WindowManager$BadTokenException: Unable to add window -- token android.view.ViewRootImpl$W@41286250 is not valid; is your activity running? at android.view

Problems creating a Popup Window in Android Activity

老子叫甜甜 提交于 2019-11-26 19:36:58
I'm trying to create a popup window that only appears the first time the application starts. I want it to display some text and have a button to close the popup. However, I'm having troubles getting the PopupWindow to even work. I've tried two different ways of doing it: First I have an XML file which declares the layout of the popup called popup.xml (a textview inside a linearlayout) and I've added this in the OnCreate() of my main Activity: PopupWindow pw = new PopupWindow(findViewById(R.id.popup), 100, 100, true); pw.showAtLocation(findViewById(R.id.main), Gravity.CENTER, 0, 0); Second I

Android Custom PopupWindow/Dialog

随声附和 提交于 2019-11-26 18:00:23
问题 I'm trying to get a completely custom Dialog or PopupWindow, without any of the default Android UI controls (title, background, buttons, whatever). Is this possible at all? I've spent hours searching for this, but no luck... It seems like this should be easily possible, but I can't find it. Preferably this would be by inflating a View from XML, but at this point anything that would just work would be nice. Thanks. 回答1: Steps I took: Create a class extending Dialog. In the onCreate, call

PopupWindow - Dismiss when clicked outside

独自空忆成欢 提交于 2019-11-26 17:23:13
I have a PopupWindow on my activity, the thing is my PopupWindow still shows even when I'm interacting with my activity (say scrolling on my list). I can scroll through my list and the PopupWindow is still there. What I want to achieve is when I'm touching/scrolling/clicking/etc on the screen which is not the PopupWindow, I want to dismiss the PopupWindow. Just like how a menu works. If you clicked outside of the menu, the menu will be dismissed. I've tried setOutsideTouchable(true) but it won't dismiss the window. Thanks. Marcin S. Please try to set setBackgroundDrawable on PopupWindow that

How to create a popup window (PopupWindow) in Android

筅森魡賤 提交于 2019-11-26 17:22:56
To create a simple working PopupWindow, we need to do the following: popup_example.xml: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:padding="10dip" android:layout_width="fill_parent" android:layout_height="wrap_content"> <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginTop="10dip" android:text="Test Pop-Up" /> </LinearLayout> Java code LayoutInflater inflater = (LayoutInflater) this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);