GithubHelp home page GithubHelp logo

Comments (11)

castorflex avatar castorflex commented on July 20, 2024

I'm not sure to understand what you want to do. Do you want to simply add a background? If yes, you can add a background to your ProgressBar (you will probably have to clip it though)

from smoothprogressbar.

derekcsm avatar derekcsm commented on July 20, 2024

Hey thanks for the reply, I've asked this question on stack overflow if you'd like to take a look

http://stackoverflow.com/questions/23019072/how-would-i-use-a-gradient-drawable-to-paint-this-canvas

I'm trying to make the solid colors in the indeterminate progress bar gradients, by using a gradient drawable, and I'm not sure how to make it work or if it would actually work.

Here is an example gif: http://bit.ly/1hyG5TF

from smoothprogressbar.

castorflex avatar castorflex commented on July 20, 2024

Are you talking about the generated background or the moving lines?

from smoothprogressbar.

derekcsm avatar derekcsm commented on July 20, 2024

The moving lines

from smoothprogressbar.

derekcsm avatar derekcsm commented on July 20, 2024

I'm thinking that something like this might work:

int x1 = 0, y1 = 0, x2 = 100,  y2 = 40;
Shader shader = new LinearGradient(x1, y1, x2, y2, Color.WHITE, Color.BLACK,
TileMode.CLAMP);
Paint paint = new Paint();
paint.setShader(shader);
canvas.drawRect(new RectF(x1, y1, x2, y2), paint);

from smoothprogressbar.

castorflex avatar castorflex commented on July 20, 2024

Do you mean something like this? https://www.youtube.com/watch?v=R8y7f10F5lc

from smoothprogressbar.

derekcsm avatar derekcsm commented on July 20, 2024

Wow amazing reply! was not expecting that, sadly no that's not what I'm looking for but it's close, is there any way of having the gradient move along the line?

Like shown in this gif: http://bit.ly/1hyG5TF

from smoothprogressbar.

derekcsm avatar derekcsm commented on July 20, 2024

If it's not possible to have it move along the line could you please let me know how you got the gradient background shown in your video (https://www.youtube.com/watch?v=R8y7f10F5lc). I'm going to try using a transition drawable.

from smoothprogressbar.

castorflex avatar castorflex commented on July 20, 2024

Oh yes, now I see. I'll try to have a look this week end

from smoothprogressbar.

derekcsm avatar derekcsm commented on July 20, 2024

I've actually had some luck using the shimmer library just by creating a custom font and overlaying it on top. It would be really cool to see some of of integration between the two libraries for that nice "shimmery" loading style.

Thanks again for the help!

TLDR; Gradient loading bars are the future :)

from smoothprogressbar.

castorflex avatar castorflex commented on July 20, 2024

Added in 97ea329

from smoothprogressbar.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.