From a7f10dfb929f1339f00b0e72f931d6e6088e4325 Mon Sep 17 00:00:00 2001 From: casey langen Date: Sun, 17 Feb 2019 00:08:27 -0800 Subject: [PATCH] Fixed an order-of-operations bug that could cause playlist track removal to not work properly in some cases. --- .../remote/ui/tracks/fragment/TrackListFragment.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/musikdroid/app/src/main/java/io/casey/musikcube/remote/ui/tracks/fragment/TrackListFragment.kt b/src/musikdroid/app/src/main/java/io/casey/musikcube/remote/ui/tracks/fragment/TrackListFragment.kt index 45d349723..1bb525d7b 100644 --- a/src/musikdroid/app/src/main/java/io/casey/musikcube/remote/ui/tracks/fragment/TrackListFragment.kt +++ b/src/musikdroid/app/src/main/java/io/casey/musikcube/remote/ui/tracks/fragment/TrackListFragment.kt @@ -56,8 +56,6 @@ class TrackListFragment: BaseFragment(), IFilterable, ITitleProvider, ITransport super.onCreate(savedInstanceState) - mixin(ItemContextMenuMixin(appCompatActivity, menuListener, this)) - extras.run { categoryType = getString(Track.Extra.CATEGORY_TYPE, "") categoryId = getLong(Track.Extra.SELECTED_ID, 0) @@ -65,6 +63,10 @@ class TrackListFragment: BaseFragment(), IFilterable, ITitleProvider, ITransport titleId = getInt(Track.Extra.TITLE_ID, titleId) } + /* needs to come after we extract categoryType -- otherwise menuListener + may get resolved to `null` */ + mixin(ItemContextMenuMixin(appCompatActivity, menuListener, this)) + queryFactory = createCategoryQueryFactory(categoryType, categoryId) }