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:
parent
898f7777ef
commit
68d421a421
2 changed files with 14 additions and 2 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue