mirror of
https://github.com/antebudimir/tempus.git
synced 2026-01-01 01:53:31 +00:00
feat: make music directory section optional
This commit is contained in:
parent
a9b264004c
commit
a508ec0af6
4 changed files with 20 additions and 0 deletions
|
|
@ -26,6 +26,7 @@ import com.cappielloantonio.tempo.ui.adapter.MusicFolderAdapter;
|
|||
import com.cappielloantonio.tempo.ui.adapter.PlaylistHorizontalAdapter;
|
||||
import com.cappielloantonio.tempo.ui.dialog.PlaylistEditorDialog;
|
||||
import com.cappielloantonio.tempo.util.Constants;
|
||||
import com.cappielloantonio.tempo.util.Preferences;
|
||||
import com.cappielloantonio.tempo.viewmodel.LibraryViewModel;
|
||||
import com.google.android.material.appbar.MaterialToolbar;
|
||||
|
||||
|
|
@ -121,6 +122,11 @@ public class LibraryFragment extends Fragment implements ClickCallback {
|
|||
}
|
||||
|
||||
private void initMusicFolderView() {
|
||||
if (!Preferences.isMusicDirectorySectionVisible()) {
|
||||
bind.libraryMusicFolderSector.setVisibility(View.GONE);
|
||||
return;
|
||||
}
|
||||
|
||||
bind.musicFolderRecyclerView.setLayoutManager(new LinearLayoutManager(requireContext()));
|
||||
bind.musicFolderRecyclerView.setHasFixedSize(true);
|
||||
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ object Preferences {
|
|||
private const val ROUNDED_CORNER_SIZE = "rounded_corner_size"
|
||||
private const val PODCAST_SECTION_VISIBILITY = "podcast_section_visibility"
|
||||
private const val RADIO_SECTION_VISIBILITY = "radio_section_visibility"
|
||||
private const val MUSIC_DIRECTORY_SECTION_VISIBILITY = "music_directory_section_visibility"
|
||||
|
||||
@JvmStatic
|
||||
fun getServer(): String? {
|
||||
|
|
@ -240,4 +241,9 @@ object Preferences {
|
|||
fun setRadioSectionHidden() {
|
||||
App.getInstance().preferences.edit().putBoolean(RADIO_SECTION_VISIBILITY, false).apply()
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun isMusicDirectorySectionVisible(): Boolean {
|
||||
return App.getInstance().preferences.getBoolean(MUSIC_DIRECTORY_SECTION_VISIBILITY, true)
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue