Fixed an order-of-operations bug that could cause playlist track removal

to not work properly in some cases.
This commit is contained in:
casey langen 2019-02-17 00:08:27 -08:00
parent ce472e6c07
commit a7f10dfb92

View File

@ -56,8 +56,6 @@ class TrackListFragment: BaseFragment(), IFilterable, ITitleProvider, ITransport
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
mixin(ItemContextMenuMixin(appCompatActivity, menuListener, this))
extras.run { extras.run {
categoryType = getString(Track.Extra.CATEGORY_TYPE, "") categoryType = getString(Track.Extra.CATEGORY_TYPE, "")
categoryId = getLong(Track.Extra.SELECTED_ID, 0) categoryId = getLong(Track.Extra.SELECTED_ID, 0)
@ -65,6 +63,10 @@ class TrackListFragment: BaseFragment(), IFilterable, ITitleProvider, ITransport
titleId = getInt(Track.Extra.TITLE_ID, titleId) 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) queryFactory = createCategoryQueryFactory(categoryType, categoryId)
} }