android-popupwindow

PopupWindow getting clipped on custom keyboard for Android API 28

蓝咒 提交于 2020-02-01 00:41:09
问题 I made a custom keyboard. When you long press a key, a PopupWindow shows some extra choices above the key. The problem is that in API 28, this popup gets clipped (or even completely hidden for the top row). I had solved this problem for API < 28 with popupWindow.setClippingEnabled(false); However, with API 28 the problem has come back. Here is more of the code: private void layoutAndShowPopupWindow(Key key, int xPosition) { popupWindow = new PopupWindow(popupView, LinearLayout.LayoutParams

PopupWindow - not working on a few devices

扶醉桌前 提交于 2020-01-23 04:26:12
问题 I use following code to show a small popup: public static PopupWindow showImportMenu(Activity activity, View anchor, PopupWindowClickListener onClickListener) { LayoutInflater inflater = LayoutInflater.from(activity); PopupImportBinding binding = DataBindingUtil.inflate(inflater, R.layout.popup_import, null, false); if (!RootTools.isRootAvailable()) binding.llImportRootMethod.setVisibility(View.GONE); PopupWindow popupWindow = new PopupWindow(activity, null, R.attr.popupMenuStyle);

Blur or dim background when Android PopupWindow active

守給你的承諾、 提交于 2020-01-18 04:09:07
问题 I would like to be able to either blur or dim the background when I show my popup window using popup.showAtLocation , and unblur/dim the background when popup.dismiss is called. I have tried applying layout params FLAG_BLUR_BEHIND and FLAG_DIM_BEHIND to my activity, but this appears to just blur and dim the background as soon my app is started. How can I do blurring/dimming just with popups? 回答1: The question was about the Popupwindow class, yet everybody has given answers that use the Dialog

Android - Popup window not showing in fragment

半腔热情 提交于 2020-01-06 02:33:15
问题 I'm creating a popupWindow but it is not showing on my Fragment when I call it. Here is my code for the popupWindow: LayoutInflater layoutInflater = (LayoutInflater)getActivity() .getSystemService(Context.LAYOUT_INFLATER_SERVICE); View popupView = layoutInflater.inflate(R.layout.popup, null); final PopupWindow popupWindow = new PopupWindow( popupView, LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); Button btnDismiss = (Button)popupView.findViewById(R.id.dismiss); btnDismiss

Android popupWindow, cant get elements within popup

狂风中的少年 提交于 2019-12-31 01:11:48
问题 I am having an issue with grabbing my Button s and other elements from within my PopupWindow , using the debugger it just report back as null ? private void initiatePopupWindow() { try { // We need to get the instance of the LayoutInflater LayoutInflater inflater = (LayoutInflater) LoginActivity.this.getSystemService(Context.LAYOUT_INFLATER_SERVICE); View layout = inflater.inflate(R.layout.activity_register,(ViewGroup) findViewById(R.id.popup_element)); pwindo = new PopupWindow(layout, 600,

Styling Android PopupMenu Divider Lines

人走茶凉 提交于 2019-12-23 09:48:07
问题 I'm using a couple of PopupMenu s in my app and they all working as expected But I would like to have white lines separating the individual items, but I can't find where I'm meant to be setting this. I was hoping I could get to the underlying ListView but that doesn't seem to be possible. I can't see an style item that relates to the divider line either. Is this possible, where/how should I be setting this? 回答1: I've been able to update the divider colour on a PopupMenu using the following

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

拥有回忆 提交于 2019-12-20 06:14:03
问题 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")){

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

爱⌒轻易说出口 提交于 2019-12-20 06:13:33
问题 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")){

How to create a popup window (PopupWindow) in Android

旧街凉风 提交于 2019-12-17 02:34:18
问题 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

Anchor SuggestionPopup to TextView

巧了我就是萌 提交于 2019-12-12 12:20:12
问题 I have a problem with a custom PopupWindow associated with a TextView with the method setSuggestionPopup . When I click in the TextView and my layout scrolls up so that the TextView is not covered by the virtual keyboard my custom popup doesn't scroll and it covers the TextView . Is there a way to anchor it to the TextView so that they are both scrolled as if they were a single object? I associate the PopupWindow to TextView like that: popupBinding = PasswordPopupBinding.inflate