android-popupwindow

How to show whatsapp like popup notification when app is in background?

喜夏-厌秋 提交于 2019-12-03 04:01:25
I have to set reminder in my app. So, Once the reminder time is reached , app has to show one popup window (Even if the app is not running) , just like how WhatsApp shows messages in popup when it is not running On tapping the button I have to launch my app also. How can I display one popup from background? Is there any samples available? Thanks in advance You can use SYSTEM_ALERT_WINDOW from your BroadcastReceiver to show one dialog window , which will be shown on top of all other apps. First add the permission <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/> in

how to make animation for popup window in android

半腔热情 提交于 2019-12-02 17:25:10
I hava a popup window in my application, its appears when some button clicked I want to set fade in animation to this window, I put the xml file in "res/anim" folder and set the animation style for the popup window but the animation does not work? here is my codes: myanim.xml... <?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android"> <alpha android:fromAlpha="0.0" android:toAlpha="1.0" android:interpolator="@android:anim/accelerate_interpolator" android:duration="4000" android:repeatCount="1"/> </set> =============================================

Show popup in recyclerView exactly where the button is, in android

泪湿孤枕 提交于 2019-12-02 12:42:04
问题 I'm working on a gridLayout with recyclerView in android.I've a an option with each grid Item where I want to show my popup activity which is another class. Please see the image - There is a menu option with each Item. and my popup activity java name is CustomPop.Class . I use a recyclerView for showing gridViews and its holder method is like public void onBindViewHolder(ViewHolder holder, int position) { holder.img_chatroom_menu.setOnClickListener(new View.OnClickListener() { @Override

Setting PopupWindow to have a maximum height

假如想象 提交于 2019-12-02 11:42:14
问题 I inflate a ListView inside a PopupWindow and I want the popup to behave like this: wrap the listview when its height is < x set the popup's height = x when the listiew's height > x (the listview being scrollable) the popup is showed by a TextWatcher attached to an EditText, as it is meant to show search suggestions. The adapter underlying the ListView is managed by a custom Loader, started whenever the user has typed something in the EditText. I tried to override onMeasure() on the listview

app crashes when spinner is pressed inside popupwindow which is located in fragment

时光怂恿深爱的人放手 提交于 2019-12-02 10:39:24
i have a fragment with a button. The button is pressed and if the user credentials entered match a valid user(the input fields ara being checked requests to rest api) a popupwindow is displayed with a spinner, a textview and an editext. in volley onresponse createPopUpWindow method is called onResponse() public void onResponse(String response) { try { JSONObject jsonObject = new JSONObject(response); String success = jsonObject.getString(AppConfig.TAG_ERROR); if (success.equals("true")){ errorresponseTtv.setText(jsonObject.getString(AppConfig.TAG_ERROR_MSG)); } else{ errorresponseTtv.setText(

Show popup in recyclerView exactly where the button is, in android

我们两清 提交于 2019-12-02 05:34:58
I'm working on a gridLayout with recyclerView in android.I've a an option with each grid Item where I want to show my popup activity which is another class. Please see the image - There is a menu option with each Item. and my popup activity java name is CustomPop.Class . I use a recyclerView for showing gridViews and its holder method is like public void onBindViewHolder(ViewHolder holder, int position) { holder.img_chatroom_menu.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Intent intent = new Intent(view.getContext(), ChatroomPopup.class); view

Can two views both have focus in Android

限于喜欢 提交于 2019-12-02 02:01:11
问题 I have a EditText, and a popupWindown(which has a ListView in it), now i touch the EditText, the popupWindow shows. i need the situation: i can input something in SoftInput, and i also can click a child item in ListView which is the children of PopupWindow. Now, i can only input, or can only click listview , i can't do the both thing in Android 4.1, 4.2. But i can do both in Android 4.4, 5.0。 I tried in many ways, like popupWindo.setFocus(true), which only make the EditText lose the focus. So

Can two views both have focus in Android

穿精又带淫゛_ 提交于 2019-12-02 00:32:30
I have a EditText, and a popupWindown(which has a ListView in it), now i touch the EditText, the popupWindow shows. i need the situation: i can input something in SoftInput, and i also can click a child item in ListView which is the children of PopupWindow. Now, i can only input, or can only click listview , i can't do the both thing in Android 4.1, 4.2. But i can do both in Android 4.4, 5.0。 I tried in many ways, like popupWindo.setFocus(true), which only make the EditText lose the focus. So, Can android allow two views both have focus ? eeffoc No, two (or more) views cannot have focus at the

Android PopupWindow Animation not working

孤街醉人 提交于 2019-12-01 21:44:24
I am showing PopupWindow on button click from top-left corner of the screen. But the problem is, when I am opening it, it will shown very fast, that means no animation occurs, but when I am closing it, its working fine, that means it is disappearing with animation. Here is my code, please help me. Main Class Code : LayoutInflater layoutInflater = (LayoutInflater) this.getSystemService(Context.LAYOUT_INFLATER_SERVICE); View layout = layoutInflater.inflate(R.layout.eosos_maptype_popup, null); final TextView txtContacts = (TextView) layout.findViewById(R.id.txtContacts); final TextView

Android Nougat 7.1.1 showAtLocation(…) Gravity not working

点点圈 提交于 2019-12-01 09:10:41
This is related to this question: Android Nougat PopupWindow showAsDropDown(...) Gravity not working However, when I applied this fix: if (android.os.Build.VERSION.SDK_INT >=24) { int[] a = new int[2]; anchorView.getLocationInWindow(a); popUp.showAtLocation(((Activity) mContext).getWindow().getDecorView(), Gravity.NO_GRAVITY, 0 , a[1]+anchorView.getHeight()); } else{ popUp.showAsDropDown(anchorView); } It doesn't work on Android Nougat 7.1.1. Particularly on Google Pixel and Nexus 6p devices. Has anybody got a fix for this? Please share. https://code.google.com/p/android/issues/detail?id