If it is set to true, it will still be dropped by miss when clicking outside. Why?
/**
* <p>Controls whether the pop-up will be informed of touch events outside
* of its window. This only makes sense for pop-ups that are touchable
* but not focusable, which means touches outside of the window will
* be delivered to the window behind. The default is false.</p>
*
* <p>If the popup is showing, calling this method will take effect only
* the next time the popup is shown or through a manual call to one of
* the {@link #update()} methods.</p>
*
* @param touchable true if the popup should receive outside
* touch events, false otherwise
*
* @see #isOutsideTouchable()
* @see #isShowing()
* @see #update()
*/
public void setOutsideTouchable(boolean touchable) {
mOutsideTouchable = touchable;
}
According to the interpretation of the official API, when focusable = false, setting setoutsidetouchable is meaningful. If focusable = true is set, it is meaningless, because focusable = true will take away the focus event. If outside can’t get the focus, then the touch of outside is useless.
So how to set focusable = true and keep external clicks from being ignored?
var isForceDismiss = false
override fun dismiss() {
if (isForceDismiss) {
super.dismiss()
isForceDismiss = true
}
}
Rewrite the Miss method of popupwindow and make a logical judgment
Read More:
- 【Q&A】Failed to start LSB: Bring up/down networking
- Solution of dynazip unzip error pop up in MindManager
- Gephi pop up JVM creation failed
- The solution to frequently pop up “cannot find a valid baseurl for repo” error prompt box in CentOS 6.7
- When installing / uninstalling SQL, a black box of command prompt will pop up, and then it will flash without response
- Start Eclipse and pop up the “Failed to load the JNI shared library jvm.dll” dialog box
- Solve the problem of “wireless network activation failure” in Ubuntu 18, and repeatedly pop up the password input interface
- [Solved] Appium Android, Appium settings and Unclock method will be installed every time the phone is started
- Writing to settings when appium of Xiaomi mobile phone and oppo mobile phone starts requires:android.permission.WRITE_ SECURE_ SETTINGS
- Another installation will pop up when Windows installs the application inprogress.you must complete that installation before continu
- When vivado2017 is started, the “error when launching” dialog box will pop up vivado.bat : Launcher time out”
- Android:Field can be converted to a local varible.
- Win10 desktop right click display settings MS- settings:display Or Ms- settings:personalization-background resolvent
- [Unity] Deterministic compilation failed. You can disable Deterministic builds in Player Settings Li
- [Solved] Unity Error: Deterministic compilation failed. You can disable Deterministic builds in Player Settings
- nvidia-settings: ERROR: nvidia-settings could not find the registry key file
- Vscode cannot write user settings. Open user settings, clear errors or warnings, and then type again
- Android Studio Series: after Android studio is opened, the project window will not be displayed.
- In the next two years, how do data analysts hang up highly educated engineers? be convinced!
- Why can’t Scala shell enter Q to exit