From 2c3318fa3ffe113c62ce4358b66272e53d547973 Mon Sep 17 00:00:00 2001 From: M66B Date: Wed, 30 Mar 2022 16:33:52 +0200 Subject: [PATCH] Debug: added logging --- app/src/main/java/eu/faircode/email/ActivityView.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app/src/main/java/eu/faircode/email/ActivityView.java b/app/src/main/java/eu/faircode/email/ActivityView.java index 2fd9331033..e17ac67cf6 100644 --- a/app/src/main/java/eu/faircode/email/ActivityView.java +++ b/app/src/main/java/eu/faircode/email/ActivityView.java @@ -66,7 +66,9 @@ import androidx.fragment.app.Fragment; import androidx.fragment.app.FragmentManager; import androidx.fragment.app.FragmentTransaction; import androidx.lifecycle.Lifecycle; +import androidx.lifecycle.LifecycleObserver; import androidx.lifecycle.Observer; +import androidx.lifecycle.OnLifecycleEvent; import androidx.localbroadcastmanager.content.LocalBroadcastManager; import androidx.preference.PreferenceManager; import androidx.recyclerview.widget.DividerItemDecoration; @@ -274,6 +276,12 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB } owner = new TwoStateOwner(this, "drawer"); + owner.getLifecycle().addObserver(new LifecycleObserver() { + @OnLifecycleEvent(Lifecycle.Event.ON_ANY) + public void onStateChanged() { + Log.i("Drawer state=" + owner.getLifecycle().getCurrentState()); + } + }); drawerLayout = findViewById(R.id.drawer_layout); final ViewGroup childContent = (ViewGroup) drawerLayout.getChildAt(0); @@ -306,6 +314,9 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB public void onDrawerSlide(View drawerView, float slideOffset) { super.onDrawerSlide(drawerView, slideOffset); + if (BuildConfig.DEBUG) + Log.i("Drawer slide=" + slideOffset); + if (slideOffset > 0) owner.start(); else