Skip to main content

Progress Bars - updating 1% at a time



I'm working on an app that shows time progress bars. I wanted the minute progress bar in this app to tick up 1% at a time. I knew that with 60000 milliseconds in a minute, this meant that updating the progress bar every 600 milliseconds should do the trick. My calculations weren't originally precise enough, however, and you can see that before the progress bar would skip 1-3% instead of 1% at a time. This was because I was doing calculations with seconds as an Int. After I switched to doing my division with Longs instead of Integers it worked great! Code on GitHub: https://github.com/amandafarrell/TimeProgressBars

Comments

Popular posts from this blog

Trip to Europe 2024

Steven and I got to go to Europe for two weeks. Our main stops were Amsterdam, Brussels, and London. The links in this post take you to videos that go along with the pictures. Amsterdam, Netherlands Flying to Amsterdam from Salt Lake City was over 9 hours and 5,000 miles. Phew. We took trains to get from Schipol Airport to our hotel. It took us a little while to figure out exactly how to get where we were going in our jet-lagged state, but after tapping in and tapping out a few times getting around anywhere in Amsterdam was so easy! Bikes - We loved seeing all the bikes. The Centraal Station bike parking lot was especially amazing with just how many bikes were there. Canal Tour - One of our first activities in Amsterdam was a canal tour. Definitely recommend! It was nice getting an overview of the city and its history. Bike tour - Our favorite part of the whole trip! We zipped along the fields around Amsterdam on electric bikes, saw windmills and electric pumps, and stopped at a fa...

Delicious Crepes

  Delicious Crepes 2 Tbs melted butter 2 eggs 1 cup flour Mix. Then add slowly: 1/2 cup milk 1/2 cup water 1/4 tsp salt

Fidget ball made from pony beads and keychain rings