Search in sources :

Example 1 with OnCheckedChanged

use of butterknife.OnCheckedChanged in project StylishMusicPlayer by ryanhoo.

the class LocalFilesFragment method onSegmentedChecked.

@OnCheckedChanged({ R.id.radio_button_all, R.id.radio_button_folder })
public void onSegmentedChecked(RadioButton radioButton, boolean isChecked) {
    int index = segmentedControls.indexOf(radioButton);
    Fragment fragment = mFragments.get(index);
    FragmentTransaction fragmentTransaction = getFragmentManager().beginTransaction();
    if (isChecked) {
        fragmentTransaction.show(fragment);
    } else {
        fragmentTransaction.hide(fragment);
    }
    fragmentTransaction.commit();
}
Also used : FragmentTransaction(android.support.v4.app.FragmentTransaction) Fragment(android.support.v4.app.Fragment) BaseFragment(io.github.ryanhoo.music.ui.base.BaseFragment) AllLocalMusicFragment(io.github.ryanhoo.music.ui.local.all.AllLocalMusicFragment) FolderFragment(io.github.ryanhoo.music.ui.local.folder.FolderFragment) OnCheckedChanged(butterknife.OnCheckedChanged)

Aggregations

Fragment (android.support.v4.app.Fragment)1 FragmentTransaction (android.support.v4.app.FragmentTransaction)1 OnCheckedChanged (butterknife.OnCheckedChanged)1 BaseFragment (io.github.ryanhoo.music.ui.base.BaseFragment)1 AllLocalMusicFragment (io.github.ryanhoo.music.ui.local.all.AllLocalMusicFragment)1 FolderFragment (io.github.ryanhoo.music.ui.local.folder.FolderFragment)1