Search in sources :

Example 1 with VideoGridFragment

use of org.videolan.vlc.gui.video.VideoGridFragment in project vlc-android by videolan.

the class MainActivity method onActivityResult.

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    if (requestCode == ACTIVITY_RESULT_PREFERENCES) {
        switch(resultCode) {
            case PreferencesActivity.RESULT_RESCAN:
                startService(new Intent(Constants.ACTION_RELOAD, null, this, MediaParsingService.class));
                break;
            case PreferencesActivity.RESULT_RESTART:
            case PreferencesActivity.RESULT_RESTART_APP:
                Intent intent = new Intent(MainActivity.this, resultCode == PreferencesActivity.RESULT_RESTART_APP ? StartActivity.class : MainActivity.class);
                finish();
                startActivity(intent);
                break;
            case PreferencesActivity.RESULT_UPDATE_SEEN_MEDIA:
                for (Fragment fragment : getSupportFragmentManager().getFragments()) if (fragment instanceof VideoGridFragment)
                    ((VideoGridFragment) fragment).updateSeenMediaMarker();
                break;
            case PreferencesActivity.RESULT_UPDATE_ARTISTS:
                final Fragment fragment = getCurrentFragment();
                if (fragment instanceof AudioBrowserFragment)
                    ((AudioBrowserFragment) fragment).updateArtists();
        }
    } else if (requestCode == ACTIVITY_RESULT_OPEN && resultCode == RESULT_OK) {
        MediaUtils.openUri(this, data.getData());
    } else if (requestCode == ACTIVITY_RESULT_SECONDARY) {
        if (resultCode == PreferencesActivity.RESULT_RESCAN) {
            forceRefresh(getCurrentFragment());
        }
    }
}
Also used : MediaParsingService(org.videolan.vlc.MediaParsingService) AudioBrowserFragment(org.videolan.vlc.gui.audio.AudioBrowserFragment) Intent(android.content.Intent) FileBrowserFragment(org.videolan.vlc.gui.browser.FileBrowserFragment) MediaBrowserFragment(org.videolan.vlc.gui.browser.MediaBrowserFragment) PreferencesFragment(org.videolan.vlc.gui.preferences.PreferencesFragment) VideoGridFragment(org.videolan.vlc.gui.video.VideoGridFragment) AudioBrowserFragment(org.videolan.vlc.gui.audio.AudioBrowserFragment) Fragment(android.support.v4.app.Fragment) NetworkBrowserFragment(org.videolan.vlc.gui.browser.NetworkBrowserFragment) MRLPanelFragment(org.videolan.vlc.gui.network.MRLPanelFragment) BaseBrowserFragment(org.videolan.vlc.gui.browser.BaseBrowserFragment) StartActivity(org.videolan.vlc.StartActivity) VideoGridFragment(org.videolan.vlc.gui.video.VideoGridFragment)

Example 2 with VideoGridFragment

use of org.videolan.vlc.gui.video.VideoGridFragment in project vlc-android by GeoffreyMetais.

the class SecondaryActivity method fetchSecondaryFragment.

public void fetchSecondaryFragment(String id) {
    switch(id) {
        case ALBUMS_SONGS:
            mFragment = new AudioAlbumsSongsFragment();
            Bundle args = new Bundle();
            args.putParcelable(AudioBrowserFragment.TAG_ITEM, getIntent().getParcelableExtra(AudioBrowserFragment.TAG_ITEM));
            mFragment.setArguments(args);
            break;
        case ABOUT:
            mFragment = new AboutFragment();
            break;
        case VIDEO_GROUP_LIST:
            mFragment = new VideoGridFragment();
            ((VideoGridFragment) mFragment).setGroup(getIntent().getStringExtra("param"));
            break;
        case STORAGE_BROWSER:
            mFragment = new StorageBrowserFragment();
            break;
        default:
            throw new IllegalArgumentException("Wrong fragment id.");
    }
}
Also used : AudioAlbumsSongsFragment(org.videolan.vlc.gui.audio.AudioAlbumsSongsFragment) Bundle(android.os.Bundle) StorageBrowserFragment(org.videolan.vlc.gui.browser.StorageBrowserFragment) VideoGridFragment(org.videolan.vlc.gui.video.VideoGridFragment)

Example 3 with VideoGridFragment

use of org.videolan.vlc.gui.video.VideoGridFragment in project vlc-android by GeoffreyMetais.

the class MainActivity method onActivityResult.

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    if (requestCode == Constants.ACTIVITY_RESULT_PREFERENCES) {
        switch(resultCode) {
            case PreferencesActivity.RESULT_RESCAN:
                startService(new Intent(Constants.ACTION_RELOAD, null, this, MediaParsingService.class));
                break;
            case PreferencesActivity.RESULT_RESTART:
            case PreferencesActivity.RESULT_RESTART_APP:
                Intent intent = new Intent(MainActivity.this, resultCode == PreferencesActivity.RESULT_RESTART_APP ? StartActivity.class : MainActivity.class);
                finish();
                startActivity(intent);
                break;
            case PreferencesActivity.RESULT_UPDATE_SEEN_MEDIA:
                for (Fragment fragment : getSupportFragmentManager().getFragments()) if (fragment instanceof VideoGridFragment)
                    ((VideoGridFragment) fragment).updateSeenMediaMarker();
                break;
            case PreferencesActivity.RESULT_UPDATE_ARTISTS:
                final Fragment fragment = getCurrentFragment();
                if (fragment instanceof AudioBrowserFragment)
                    ((AudioBrowserFragment) fragment).updateArtists();
        }
    } else if (requestCode == Constants.ACTIVITY_RESULT_OPEN && resultCode == RESULT_OK) {
        MediaUtils.openUri(this, data.getData());
    } else if (requestCode == Constants.ACTIVITY_RESULT_SECONDARY) {
        if (resultCode == PreferencesActivity.RESULT_RESCAN) {
            forceRefresh(getCurrentFragment());
        }
    }
}
Also used : MediaParsingService(org.videolan.vlc.MediaParsingService) AudioBrowserFragment(org.videolan.vlc.gui.audio.AudioBrowserFragment) Intent(android.content.Intent) PreferencesFragment(org.videolan.vlc.gui.preferences.PreferencesFragment) VideoGridFragment(org.videolan.vlc.gui.video.VideoGridFragment) AudioBrowserFragment(org.videolan.vlc.gui.audio.AudioBrowserFragment) Fragment(android.support.v4.app.Fragment) BaseBrowserFragment(org.videolan.vlc.gui.browser.BaseBrowserFragment) StartActivity(org.videolan.vlc.StartActivity) VideoGridFragment(org.videolan.vlc.gui.video.VideoGridFragment)

Example 4 with VideoGridFragment

use of org.videolan.vlc.gui.video.VideoGridFragment in project vlc-android by GeoffreyMetais.

the class ContentActivity method makeRoomForSearch.

// Hide options menu items to make room for filter EditText
protected void makeRoomForSearch(Fragment current, boolean hide) {
    final Menu menu = mToolbar.getMenu();
    menu.findItem(R.id.ml_menu_renderers).setVisible(!hide && showRenderers);
    if (current instanceof MediaBrowserFragment) {
        menu.findItem(R.id.ml_menu_sortby).setVisible(!hide && ((MediaBrowserFragment) current).getProvider().canSortByName());
    }
    if (current instanceof VideoGridFragment || current instanceof AudioBrowserFragment) {
        menu.findItem(R.id.ml_menu_last_playlist).setVisible(!hide);
    }
}
Also used : AudioBrowserFragment(org.videolan.vlc.gui.audio.AudioBrowserFragment) Menu(android.view.Menu) MediaBrowserFragment(org.videolan.vlc.gui.browser.MediaBrowserFragment) VideoGridFragment(org.videolan.vlc.gui.video.VideoGridFragment)

Example 5 with VideoGridFragment

use of org.videolan.vlc.gui.video.VideoGridFragment in project vlc-android by videolan.

the class SecondaryActivity method fetchSecondaryFragment.

public void fetchSecondaryFragment(String id) {
    switch(id) {
        case ALBUMS_SONGS:
            mFragment = new AudioAlbumsSongsFragment();
            Bundle args = new Bundle();
            args.putParcelable(AudioBrowserFragment.TAG_ITEM, getIntent().getParcelableExtra(AudioBrowserFragment.TAG_ITEM));
            mFragment.setArguments(args);
            break;
        case ABOUT:
            mFragment = new AboutFragment();
            break;
        case VIDEO_GROUP_LIST:
            mFragment = new VideoGridFragment();
            ((VideoGridFragment) mFragment).setGroup(getIntent().getStringExtra("param"));
            break;
        case STORAGE_BROWSER:
            mFragment = new StorageBrowserFragment();
            break;
        default:
            throw new IllegalArgumentException("Wrong fragment id.");
    }
}
Also used : AudioAlbumsSongsFragment(org.videolan.vlc.gui.audio.AudioAlbumsSongsFragment) Bundle(android.os.Bundle) StorageBrowserFragment(org.videolan.vlc.gui.browser.StorageBrowserFragment) VideoGridFragment(org.videolan.vlc.gui.video.VideoGridFragment)

Aggregations

VideoGridFragment (org.videolan.vlc.gui.video.VideoGridFragment)6 AudioBrowserFragment (org.videolan.vlc.gui.audio.AudioBrowserFragment)4 Intent (android.content.Intent)2 Bundle (android.os.Bundle)2 Fragment (android.support.v4.app.Fragment)2 Menu (android.view.Menu)2 MediaParsingService (org.videolan.vlc.MediaParsingService)2 StartActivity (org.videolan.vlc.StartActivity)2 AudioAlbumsSongsFragment (org.videolan.vlc.gui.audio.AudioAlbumsSongsFragment)2 BaseBrowserFragment (org.videolan.vlc.gui.browser.BaseBrowserFragment)2 MediaBrowserFragment (org.videolan.vlc.gui.browser.MediaBrowserFragment)2 StorageBrowserFragment (org.videolan.vlc.gui.browser.StorageBrowserFragment)2 PreferencesFragment (org.videolan.vlc.gui.preferences.PreferencesFragment)2 FileBrowserFragment (org.videolan.vlc.gui.browser.FileBrowserFragment)1 NetworkBrowserFragment (org.videolan.vlc.gui.browser.NetworkBrowserFragment)1 SortableFragment (org.videolan.vlc.gui.browser.SortableFragment)1 MRLPanelFragment (org.videolan.vlc.gui.network.MRLPanelFragment)1