Debug: added logging

This commit is contained in:
M66B 2022-03-30 16:33:52 +02:00
parent 702416989a
commit 2c3318fa3f
1 changed files with 11 additions and 0 deletions

View File

@ -66,7 +66,9 @@ import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager; import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction; import androidx.fragment.app.FragmentTransaction;
import androidx.lifecycle.Lifecycle; import androidx.lifecycle.Lifecycle;
import androidx.lifecycle.LifecycleObserver;
import androidx.lifecycle.Observer; import androidx.lifecycle.Observer;
import androidx.lifecycle.OnLifecycleEvent;
import androidx.localbroadcastmanager.content.LocalBroadcastManager; import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import androidx.preference.PreferenceManager; import androidx.preference.PreferenceManager;
import androidx.recyclerview.widget.DividerItemDecoration; import androidx.recyclerview.widget.DividerItemDecoration;
@ -274,6 +276,12 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
} }
owner = new TwoStateOwner(this, "drawer"); 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); drawerLayout = findViewById(R.id.drawer_layout);
final ViewGroup childContent = (ViewGroup) drawerLayout.getChildAt(0); 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) { public void onDrawerSlide(View drawerView, float slideOffset) {
super.onDrawerSlide(drawerView, slideOffset); super.onDrawerSlide(drawerView, slideOffset);
if (BuildConfig.DEBUG)
Log.i("Drawer slide=" + slideOffset);
if (slideOffset > 0) if (slideOffset > 0)
owner.start(); owner.start();
else else