Search in sources :

Example 1 with AdvancedToolbar

use of com.github.anrimian.musicplayer.ui.common.toolbar.AdvancedToolbar in project music-player by Anrimian.

the class SettingsFragment method onViewCreated.

@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    AdvancedToolbar toolbar = requireActivity().findViewById(R.id.toolbar);
    navigation = FragmentNavigation.from(getParentFragmentManager());
    viewBinding.tvDisplay.setOnClickListener(v -> navigation.addNewFragment(new DisplaySettingsFragment()));
    viewBinding.tvLibrary.setOnClickListener(v -> navigation.addNewFragment(new LibrarySettingsFragment()));
    viewBinding.tvPlayer.setOnClickListener(v -> navigation.addNewFragment(new PlayerSettingsFragment()));
    viewBinding.tvTheme.setOnClickListener(v -> navigation.addNewFragment(new ThemeSettingsFragment()));
    viewBinding.tvHeadset.setOnClickListener(v -> navigation.addNewFragment(new HeadsetSettingsFragment()));
    viewBinding.llRunRescanStorage.setOnClickListener(v -> onRescanStorageButtonClicked());
    SlidrPanel.simpleSwipeBack(viewBinding.flContainer, this, toolbar::onStackFragmentSlided);
}
Also used : ThemeSettingsFragment(com.github.anrimian.musicplayer.ui.settings.themes.ThemeSettingsFragment) HeadsetSettingsFragment(com.github.anrimian.musicplayer.ui.settings.headset.HeadsetSettingsFragment) PlayerSettingsFragment(com.github.anrimian.musicplayer.ui.settings.player.PlayerSettingsFragment) DisplaySettingsFragment(com.github.anrimian.musicplayer.ui.settings.display.DisplaySettingsFragment) AdvancedToolbar(com.github.anrimian.musicplayer.ui.common.toolbar.AdvancedToolbar) LibrarySettingsFragment(com.github.anrimian.musicplayer.ui.settings.library.LibrarySettingsFragment)

Example 2 with AdvancedToolbar

use of com.github.anrimian.musicplayer.ui.common.toolbar.AdvancedToolbar in project music-player by Anrimian.

the class ExcludedFoldersFragment method onViewCreated.

@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    AdvancedToolbar toolbar = requireActivity().findViewById(R.id.toolbar);
    toolbar.setTitle(R.string.excluded_folders);
    toolbar.setSubtitle(null);
    toolbar.setTitleClickListener(null);
    adapter = new ExcludedFolderAdapter(recyclerView, presenter::onDeleteFolderClicked);
    recyclerView.setAdapter(adapter);
    recyclerView.setLayoutManager(new LinearLayoutManager(requireContext()));
    SlidrPanel.simpleSwipeBack(clContainer, this, toolbar::onStackFragmentSlided);
}
Also used : ExcludedFolderAdapter(com.github.anrimian.musicplayer.ui.settings.folders.view.ExcludedFolderAdapter) AdvancedToolbar(com.github.anrimian.musicplayer.ui.common.toolbar.AdvancedToolbar) LinearLayoutManager(androidx.recyclerview.widget.LinearLayoutManager)

Example 3 with AdvancedToolbar

use of com.github.anrimian.musicplayer.ui.common.toolbar.AdvancedToolbar in project music-player by Anrimian.

the class LibraryFoldersRootFragment method onFragmentMovedOnTop.

@Override
public void onFragmentMovedOnTop() {
    super.onFragmentMovedOnTop();
    AdvancedToolbar toolbar = requireActivity().findViewById(R.id.toolbar);
    toolbar.setSubtitle(R.string.folders);
    FragmentNavigation folderNavigation = FragmentNavigation.from(getChildFragmentManager());
    if (folderNavigation.isInitialized()) {
        folderNavigation.dispatchMovedToTop();
    }
}
Also used : FragmentNavigation(com.github.anrimian.musicplayer.ui.utils.fragments.navigation.FragmentNavigation) AdvancedToolbar(com.github.anrimian.musicplayer.ui.common.toolbar.AdvancedToolbar)

Example 4 with AdvancedToolbar

use of com.github.anrimian.musicplayer.ui.common.toolbar.AdvancedToolbar in project music-player by Anrimian.

the class ExcludedFoldersFragment method onFragmentMovedOnTop.

@Override
public void onFragmentMovedOnTop() {
    AdvancedToolbar toolbar = requireActivity().findViewById(R.id.toolbar);
    toolbar.clearOptionsMenu();
}
Also used : AdvancedToolbar(com.github.anrimian.musicplayer.ui.common.toolbar.AdvancedToolbar)

Example 5 with AdvancedToolbar

use of com.github.anrimian.musicplayer.ui.common.toolbar.AdvancedToolbar in project music-player by Anrimian.

the class HeadsetSettingsFragment method onViewCreated.

@Override
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    AdvancedToolbar toolbar = requireActivity().findViewById(R.id.toolbar);
    toolbar.setTitle(R.string.settings);
    toolbar.setSubtitle(R.string.headset);
    toolbar.setTitleClickListener(null);
    rxPermissions = new RxPermissions(requireActivity());
    SlidrPanel.simpleSwipeBack(viewBinding.clContainer, this, toolbar::onStackFragmentSlided);
    onCheckChanged(viewBinding.cbPlayOnConnect, this::onPlayOnConnectChecked);
    setChecked(viewBinding.cbPlayOnConnect, BluetoothConnectionReceiver.isEnabled(requireContext()));
}
Also used : RxPermissions(com.tbruyelle.rxpermissions3.RxPermissions) AdvancedToolbar(com.github.anrimian.musicplayer.ui.common.toolbar.AdvancedToolbar)

Aggregations

AdvancedToolbar (com.github.anrimian.musicplayer.ui.common.toolbar.AdvancedToolbar)7 GridLayoutManager (androidx.recyclerview.widget.GridLayoutManager)1 LinearLayoutManager (androidx.recyclerview.widget.LinearLayoutManager)1 RecyclerView (androidx.recyclerview.widget.RecyclerView)1 DisplaySettingsFragment (com.github.anrimian.musicplayer.ui.settings.display.DisplaySettingsFragment)1 ExcludedFolderAdapter (com.github.anrimian.musicplayer.ui.settings.folders.view.ExcludedFolderAdapter)1 HeadsetSettingsFragment (com.github.anrimian.musicplayer.ui.settings.headset.HeadsetSettingsFragment)1 LibrarySettingsFragment (com.github.anrimian.musicplayer.ui.settings.library.LibrarySettingsFragment)1 PlayerSettingsFragment (com.github.anrimian.musicplayer.ui.settings.player.PlayerSettingsFragment)1 ThemeSettingsFragment (com.github.anrimian.musicplayer.ui.settings.themes.ThemeSettingsFragment)1 ThemesAdapter (com.github.anrimian.musicplayer.ui.settings.themes.view.ThemesAdapter)1 FragmentNavigation (com.github.anrimian.musicplayer.ui.utils.fragments.navigation.FragmentNavigation)1 RxPermissions (com.tbruyelle.rxpermissions3.RxPermissions)1