Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only first image is displayed #3

Open
ghanshyambagul opened this issue Apr 14, 2018 · 1 comment
Open

Only first image is displayed #3

ghanshyambagul opened this issue Apr 14, 2018 · 1 comment

Comments

@ghanshyambagul
Copy link

Hello,
I successfully used this view in my app but when I am setting GIF by using InputStream only first image is displayed.

Please any suggestion...

My code is....

    final GIFView mGifView = (GIFView) findViewById(R.id.main_activity_gif_vie);

    InputStream is=null;
    try {
        is=new FileInputStream("/sdcard/test.gif");

        mGifView.setGifResource(is);



    } catch (FileNotFoundException e) {
        e.printStackTrace();
    }


    mGifView.setOnSettingGifListener(new GIFView.OnSettingGifListener() {
        @Override
        public void onSuccess(GIFView view, Exception e) {
            Toast.makeText(Main2Activity.this, "onSuccess()", Toast.LENGTH_SHORT).show();
            mGifView.start(); // I have tested with and without this statement
        }

        @Override
        public void onFailure(GIFView view, Exception e) {
        }
    });
@ghanshyambagul ghanshyambagul changed the title Only frst image is displayed Only first image is displayed Apr 14, 2018
@Gavras
Copy link
Owner

Gavras commented Apr 14, 2018

I tested it with few InputStreams and it worked.

Did you try with different file? Maybe the problem is with the file?
Note that every time you set a GIF resource (even from a string in your asset directory) the library is using its InputStream.
You can also try to check the exception passed in GIFView.OnSettingGifListener#onFailure, maybe it caught something.

If you see the first image it means that at least it has the first frame so what is the result when you invoke getGifDuration()?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants