lorensiuswlt / NewQuickAction3D

Gallery3D like quickaction
http://www.londatiga.net/it/how-to-create-quickaction-dialog-in-android/
Apache License 2.0
400 stars 236 forks source link

click on ActionItem sometimes cause popup window transparent #3

Open kojilin opened 12 years ago

kojilin commented 12 years ago

when ActionItem has onclick effect like action_item_btn.xml and quickAction dismissed, it sometimes cause popupwindow has transparent rectangle.

like below: https://docs.google.com/leaf?id=0BwrpgpmcQWZXMTI0NzExZWUtMmNlMS00MzBhLWEzODAtYTgwZDk3N2NlYTVl&hl=zh_TW

xhandros commented 12 years ago

I´ve the same problem, I appreciate any help.

eo commented 12 years ago

I also have the exact same problem.

xhandros commented 12 years ago

I think that is a cyanogen problem (in my case) because this behavior is the same in the system app's popupwindow

pacificsky commented 12 years ago

The problem is this line in PopupWindows.java: mWindow.setBackgroundDrawable(new BitmapDrawable());

Remove the if/else clause completely and change it to: mWindow.setBackgroundDrawable(mBackground);

It's OK to set a null background on PopupWindow. And it fixes this issue :-)

coup commented 12 years ago

if you will remove mWindow.setBackgroundDrawable(new BitmapDrawable()); then once the QuickAction gets open and if you try to click on some other part of the screen then it will not get closed automatically.

so mWindow.setBackgroundDrawable(null); wont be the solution

khaykov commented 11 years ago

sunloverz wrote solution (if you can call it like this) in NewQuickAction project discussions. It works with NewQuickAction3D. Just change dismiss() method in PopupWindows.java to something like this:

public void dismiss() {
        final Handler handler = new Handler();
        handler.postDelayed(new Runnable() {
            @Override
            public void run() {
                // Will be called after 1 ms
                mWindow.dismiss();
            }
        }, 1);
    }

Works for me.