Search in sources :

Example 1 with ImageViewerFragment

use of com.frostwire.android.gui.fragments.ImageViewerFragment in project frostwire by frostwire.

the class ImageViewerActivity method initComponents.

@Override
protected void initComponents(Bundle savedInstanceState) {
    Intent intent = getIntent();
    Bundle fileDescriptorBundle = intent.getBundleExtra(ImageViewerFragment.EXTRA_FILE_DESCRIPTOR_BUNDLE);
    if (fileDescriptorBundle != null && !fileDescriptorBundle.isEmpty()) {
        FileDescriptor fd = new FileDescriptor(fileDescriptorBundle);
        int position = intent.getIntExtra(ImageViewerFragment.EXTRA_ADAPTER_FILE_OFFSET, -1);
        ImageViewerFragment imageViewerFragment = findFragment(R.id.fragment_image_viewer);
        imageViewerFragment.updateData(fd, position);
        fileDescriptorBundle.clear();
    }
}
Also used : Bundle(android.os.Bundle) Intent(android.content.Intent) ImageViewerFragment(com.frostwire.android.gui.fragments.ImageViewerFragment) FileDescriptor(com.frostwire.android.core.FileDescriptor)

Aggregations

Intent (android.content.Intent)1 Bundle (android.os.Bundle)1 FileDescriptor (com.frostwire.android.core.FileDescriptor)1 ImageViewerFragment (com.frostwire.android.gui.fragments.ImageViewerFragment)1