shts / StoriesProgressView

show horizontal progress like instagram stories.
Apache License 2.0
885 stars 203 forks source link

StoriesProgressView using urls #7

Open vinc4 opened 6 years ago

vinc4 commented 6 years ago

how do i load images using urls not drawables

shts commented 6 years ago

can't ....

vinc4 commented 6 years ago

Even videos ??

On 22 Nov 2017 10:35, "Shota Saito" notifications@github.com wrote:

can't ....

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/shts/StoriesProgressView/issues/7#issuecomment-346279466, or mute the thread https://github.com/notifications/unsubscribe-auth/AYLV_TM2w6Rusg3wIEdPsmeMHgVEpShtks5s49zQgaJpZM4QUXjy .

shts commented 6 years ago

Oh, Are you referring to sample code ?? I'm afraid, Please check it yourself for non-StoriesProgressView.

vinc4 commented 6 years ago

I want a story view with images and videos like what's aap

On 22 Nov 2017 10:59, "Shota Saito" notifications@github.com wrote:

Oh, Are you referring to sample code ?? I'm afraid, Please check it yourself for non-StoriesProgressView.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/shts/StoriesProgressView/issues/7#issuecomment-346285362, or mute the thread https://github.com/notifications/unsubscribe-auth/AYLV_XSgREHrjrCrlJ6MwYinnQ16rUOkks5s4-JugaJpZM4QUXjy .

jjimenez0611 commented 6 years ago

could be very cool if a can't use this library with Glide or Picasso to load images or videos like instagram, facebook, whatsapp... I really like this library, but can't to use for my purpose, because I need load the images from the server..

ghost commented 6 years ago

You can load images from a server. Use a single void method to make glide update your image view and progress the story.

On Sat, 23 Jun 2018 at 10:46 am, Jose Jimenez notifications@github.com wrote:

could be very cool if a can't use this library with Glide or Picasso to load images or videos like instagram, facebook, whatsapp... I really like this library, but can't to use for my purpose, because I need load the images from the server..

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/shts/StoriesProgressView/issues/7#issuecomment-399617107, or mute the thread https://github.com/notifications/unsubscribe-auth/AIgngmxPKH0JaNkg1Hg0u1WO7Ac5tyKUks5t_Y_zgaJpZM4QUXjy .

-- Regards Brandon Stillitano Project Manager 0401 007 904 <javascript:void(0);>

jjimenez0611 commented 6 years ago

@Xenero Hi

You say that I can call a single method with Glide implementation, and call this method in the onNext and onPreview?

for example:

@Override onNext(){ GlideApp .with(myFragment) .load(url) .centerCrop() .placeholder(R.drawable.loading_spinner) .into(myImageView); }

something like that.....

ghost commented 6 years ago

Not really. You’d have a method Like:

void methodName() { Glide.with.load...... storyView.skip(); }

On Sat, 23 Jun 2018 at 10:55 am, Jose Jimenez notifications@github.com wrote:

@Xenero https://github.com/Xenero Hi

You say that I can call a single method with Glide implementation, and call this method in the onNext and onPreview?

for example:

@override https://github.com/override onNext(){ GlideApp .with(myFragment) .load(url) .centerCrop() .placeholder(R.drawable.loading_spinner) .into(myImageView); }

something like that.....

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/shts/StoriesProgressView/issues/7#issuecomment-399617778, or mute the thread https://github.com/notifications/unsubscribe-auth/AIgngv-iyI-k85TPgmClbNKdQEyzJTkCks5t_ZIWgaJpZM4QUXjy .

-- Regards Brandon Stillitano Project Manager 0401 007 904 <javascript:void(0);>

jjimenez0611 commented 6 years ago

@Xenero

mmmm I will try... it is not very clear to me yet... Because, how to set the image from glide to the storyview?

for example If I receive from the server 4 images, I have to wait for all the images to download and then set to the storyView?

Sorry for my english.. And sorry for all the questions...

jjimenez0611 commented 6 years ago

@Xenero Thanks

I understand...

I can do it.. thank for the idea. 👍

ProMadGenius commented 6 years ago

can you share the code please jimenez? thanks!

milanbhuva commented 6 years ago

Hello, i m new to android development, currently i m developing instagram clone with firebase. i have seen your demo but the issue is i am unable to set images, which i fetch from the firebase as i see in your demo you just use the static path of images stored in array and show in storyprogress view.

jjimenez0611 commented 6 years ago

Hi @ProMadGenius

I have some problems with the onPause with this library, I try to fix it but can't...

Finally I use another library of segment progress bar to Android, is more simple and it doesn't has listeners to know when a segment finish.. So I download the code of the library and modify to add the listener that I needed..

And then I use glide to know when the resource is ready and start the segment and add the listener to know when the segment is finish and past to the next image..

The name of this library is Segmented progress bar... Maybe you can see is very easy to understand..

ProMadGenius commented 6 years ago

Yes i watched that library... can i sent you a email? so u can help me a bit? :'v I will love that. Thanks for your response anyway, have nice day.

jjimenez0611 commented 6 years ago

@ProMadGenius sure not problem send me a message... josean5665@gmail.com

pritesh25 commented 6 years ago

i wanna start time duration when image is successfully loaded into imageView , how i can achieve this ??

i tried to use handler i.e. after 5 second handler will call skip() method , but it not working. even , if u not use storiesProgressView.setStoryDuration(5000L) method you wont be able to call skip method.

thank you

here is my code

private void loadImageFromPicasso(String url) {

        Log.d(TAG,"picasso loading url = "+url);

        pb.setVisibility(View.VISIBLE);
        Picasso.get().load(url).placeholder(R.color.gray).into(image, new Callback() {
            @Override
            public void onSuccess() {
                Log.d(TAG,"picasso success");
                pb.setVisibility(View.INVISIBLE);
                //storiesProgressView.setStoryDuration(5000L);

                new Handler().postDelayed(new Runnable() {
                    @Override
                    public void run() {
                        storiesProgressView.skip();
                    }
                },5000);
            }

            @Override
            public void onError(Exception e) {
                pb.setVisibility(View.INVISIBLE);
                //storiesProgressView.setStoryDuration(null);
                Log.d(TAG,"picasso error");
            }
        });
    }
shts commented 6 years ago

@pritesh25 Try new Handler(Looper.getMainLooper())

pritesh25 commented 6 years ago

@shts i want to start progressbar when image loaded from network to imageview [im using picasso].before loading image from network into imageview should be paused.once image successfully loaded into imageview then progressbar should start. how i can achieve this ? is there any method ? thank you

yoonusc commented 5 years ago

@pritesh25 did you find solution?

uzman commented 5 years ago

Using it with Glide: write a method for glide, then call start ProgressBar.

    private void updateImageView(){
        spinner.setVisibility(View.VISIBLE);
        String imageurl = resources[counter];
        Glide.with(getActivity())
                .load(imageurl)
                .apply(glideRequestOptions)
                //.transition(withCrossFade())
                .listener(new RequestListener<Drawable>() {
                    @Override
                    public boolean onLoadFailed(@Nullable GlideException e, Object model, Target<Drawable> target, boolean isFirstResource) {
                        startProgressView();
                        return false;
                    }

                    @Override
                    public boolean onResourceReady(Drawable resource, Object model, Target<Drawable> target, DataSource dataSource, boolean isFirstResource) {
                        startProgressView();
                        return false;
                    }
                })
                .into(imageView)

        ;

    }

    private void startProgressView(){
        spinner.setVisibility(View.GONE);
        storiesProgressView.destroy();
        storiesProgressView.startStories(counter);
    }

           @Override
            public void onNext() {
                Log.d("STORY next", "" + counter);
                if (counter>resources.length-1) return;
                counter++;
                updateImageView();
            }

            @Override
            public void onPrev() {
                Log.d("STORY prev", "" + counter);
                if ((counter - 1) < 0) return;
                counter--;
                updateImageView();

            }

            @Override
            public void onComplete() {
                Log.d("STORY compl", "" + counter);

            }
simrankathuria commented 5 years ago

Does this library working with server images?

jjimenez0611 commented 5 years ago

Yes, you can show server images with GLIDE

dinesh750 commented 5 years ago

Yes, you can show server images with GLIDE

Can you help me with the code how you are using it .Thanks in Advance.