Search in sources :

Example 1 with Filterable

use of org.videolan.vlc.interfaces.Filterable in project vlc-android by videolan.

the class ContentActivity method onCreateOptionsMenu.

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    mMenu = menu;
    if (getSupportFragmentManager().findFragmentById(R.id.fragment_placeholder) instanceof AboutFragment)
        return true;
    getMenuInflater().inflate(R.menu.activity_option, menu);
    if (getCurrentFragment() instanceof ExtensionBrowser) {
        menu.findItem(R.id.ml_menu_last_playlist).setVisible(false);
        menu.findItem(R.id.ml_menu_sortby).setVisible(false);
    }
    if (getCurrentFragment() instanceof Filterable) {
        MenuItem searchItem = menu.findItem(R.id.ml_menu_filter);
        mSearchView = (SearchView) MenuItemCompat.getActionView(searchItem);
        mSearchView.setQueryHint(getString(R.string.search_list_hint));
        mSearchView.setOnQueryTextListener(this);
        MenuItemCompat.setOnActionExpandListener(searchItem, this);
    } else
        menu.findItem(R.id.ml_menu_filter).setVisible(false);
    menu.findItem(R.id.ml_menu_renderers).setVisible(showRenderers);
    menu.findItem(R.id.ml_menu_renderers).setIcon(RendererDelegate.INSTANCE.getSelectedRenderer() == null ? R.drawable.ic_am_renderer_normal_w : R.drawable.ic_am_renderer_on_w);
    return super.onCreateOptionsMenu(menu);
}
Also used : Filterable(org.videolan.vlc.interfaces.Filterable) ExtensionBrowser(org.videolan.vlc.gui.browser.ExtensionBrowser) MenuItem(android.view.MenuItem)

Example 2 with Filterable

use of org.videolan.vlc.interfaces.Filterable in project vlc-android by videolan.

the class ContentActivity method setSearchVisibility.

private void setSearchVisibility(boolean visible) {
    final Fragment current = getCurrentFragment();
    if (current instanceof Filterable) {
        ((Filterable) current).setSearchVisibility(visible);
        makeRoomForSearch(current, visible);
    }
}
Also used : Filterable(org.videolan.vlc.interfaces.Filterable) SortableFragment(org.videolan.vlc.gui.browser.SortableFragment) Fragment(android.support.v4.app.Fragment) EqualizerFragment(org.videolan.vlc.gui.audio.EqualizerFragment) VideoGridFragment(org.videolan.vlc.gui.video.VideoGridFragment) AudioBrowserFragment(org.videolan.vlc.gui.audio.AudioBrowserFragment)

Example 3 with Filterable

use of org.videolan.vlc.interfaces.Filterable in project vlc-android by GeoffreyMetais.

the class ContentActivity method setSearchVisibility.

private void setSearchVisibility(boolean visible) {
    final Fragment current = getCurrentFragment();
    if (current instanceof Filterable) {
        ((Filterable) current).setSearchVisibility(visible);
        makeRoomForSearch(current, visible);
    }
}
Also used : Filterable(org.videolan.vlc.interfaces.Filterable) MediaBrowserFragment(org.videolan.vlc.gui.browser.MediaBrowserFragment) EqualizerFragment(org.videolan.vlc.gui.audio.EqualizerFragment) VideoGridFragment(org.videolan.vlc.gui.video.VideoGridFragment) AudioBrowserFragment(org.videolan.vlc.gui.audio.AudioBrowserFragment) Fragment(android.support.v4.app.Fragment)

Example 4 with Filterable

use of org.videolan.vlc.interfaces.Filterable in project vlc-android by GeoffreyMetais.

the class ContentActivity method onCreateOptionsMenu.

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    if (getSupportFragmentManager().findFragmentById(R.id.fragment_placeholder) instanceof AboutFragment)
        return true;
    getMenuInflater().inflate(R.menu.activity_option, menu);
    if (getCurrentFragment() instanceof ExtensionBrowser) {
        menu.findItem(R.id.ml_menu_last_playlist).setVisible(false);
        menu.findItem(R.id.ml_menu_sortby).setVisible(false);
    }
    if (getCurrentFragment() instanceof Filterable) {
        final MenuItem searchItem = menu.findItem(R.id.ml_menu_filter);
        mSearchView = (SearchView) searchItem.getActionView();
        mSearchView.setQueryHint(getString(R.string.search_list_hint));
        mSearchView.setOnQueryTextListener(this);
        searchItem.setOnActionExpandListener(this);
    } else
        menu.findItem(R.id.ml_menu_filter).setVisible(false);
    menu.findItem(R.id.ml_menu_renderers).setVisible(showRenderers);
    menu.findItem(R.id.ml_menu_renderers).setIcon(!RendererDelegate.INSTANCE.hasRenderer() ? R.drawable.ic_am_renderer_normal_w : R.drawable.ic_am_renderer_on_w);
    return super.onCreateOptionsMenu(menu);
}
Also used : Filterable(org.videolan.vlc.interfaces.Filterable) ExtensionBrowser(org.videolan.vlc.gui.browser.ExtensionBrowser) MenuItem(android.view.MenuItem)

Aggregations

Filterable (org.videolan.vlc.interfaces.Filterable)4 Fragment (android.support.v4.app.Fragment)2 MenuItem (android.view.MenuItem)2 AudioBrowserFragment (org.videolan.vlc.gui.audio.AudioBrowserFragment)2 EqualizerFragment (org.videolan.vlc.gui.audio.EqualizerFragment)2 ExtensionBrowser (org.videolan.vlc.gui.browser.ExtensionBrowser)2 VideoGridFragment (org.videolan.vlc.gui.video.VideoGridFragment)2 MediaBrowserFragment (org.videolan.vlc.gui.browser.MediaBrowserFragment)1 SortableFragment (org.videolan.vlc.gui.browser.SortableFragment)1