musikr: fix build problems

This commit is contained in:
Alexander Capehart 2025-02-10 13:44:49 -07:00
parent 210285b39a
commit 9632e06ca6
No known key found for this signature in database
GPG key ID: 37DBE3621FE9AD47
2 changed files with 23 additions and 6 deletions

View file

@ -270,9 +270,7 @@ class HomeFragment :
// Set up the mapping between the ViewPager and TabLayout.
TabLayoutMediator(
binding.homeTabs,
binding.homePager,
NamedTabStrategy(homeModel.currentTabTypes))
binding.homeTabs, binding.homePager, NamedTabStrategy(homeModel.currentTabTypes))
.attach()
}

View file

@ -1,10 +1,29 @@
/*
* Copyright (c) 2025 Auxio Project
* NamedTabStrategy.kt is part of Auxio.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package org.oxycblt.auxio.home.tabs
import com.google.android.material.tabs.TabLayout
import com.google.android.material.tabs.TabLayoutMediator.TabConfigurationStrategy
import org.oxycblt.auxio.music.MusicType
class NamedTabStrategy(private val homeTabs: List<Tab>) : TabConfigurationStrategy {
class NamedTabStrategy(private val homeTabs: List<MusicType>) : TabConfigurationStrategy {
override fun onConfigureTab(tab: TabLayout.Tab, position: Int) {
tab.setText(homeTabs[position].type.nameRes)
tab.setText(homeTabs[position].nameRes)
}
}
}