1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2025-01-01 04:35:57 +00:00

Dismiss popup on detaching anchor

This commit is contained in:
M66B 2019-09-21 16:15:55 +02:00
parent 898f7777ef
commit 68d421a421
2 changed files with 14 additions and 2 deletions

View file

@ -13,8 +13,8 @@ android {
applicationId "eu.faircode.email"
minSdkVersion 21
targetSdkVersion 29
versionCode 717
versionName "1.717"
versionCode 718
versionName "1.718"
archivesBaseName = "FairEmail-v$versionName"
// https://en.wikipedia.org/wiki/List_of_dinosaur_genera

View file

@ -36,6 +36,18 @@ public class PopupMenuLifecycle extends PopupMenu implements LifecycleObserver {
super(context, anchor);
this.owner = owner;
Log.i("Instantiate " + this);
anchor.addOnAttachStateChangeListener(new View.OnAttachStateChangeListener() {
@Override
public void onViewAttachedToWindow(View v) {
// Do nothing
}
@Override
public void onViewDetachedFromWindow(View v) {
PopupMenuLifecycle.this.dismiss();
}
});
}
@Override