MuhammadUsamaSiddiqui/circular_countdown_timer

Customize text

Closed this issue · 3 comments

Hello! Thanks for writing such great extension.

I was wondering whether you could add a feature that I can customize the text during count down (in the center of the circle)?

Thank you again!

solved with pull request #35

It's a shame pull request #35 was closed out.... Any chance of reviving it?

Sorry, somehow I missed that Pull Request. As Pull request is closed and the request branch is deleted. Therefore, I have added this functionality manually according to the updated code. Thanks @JesusHdezWaterloo for your contribution.

/* 
   * Function to format the text.
   * Allows you to format the current duration to any String.
   * It also provides the default function in case you want to format specific moments
      as in reverse when reaching '0' show 'GO', and for the rest of the instances follow 
      the default behavior.
*/
  
  timeFormatterFunction: (defaultFormatterFunction, duration) {
     if (duration.inSeconds == 0) {
          // only format for '0'
          return "Start";
     } else {
          // other durations by it's default format
          return Function.apply(defaultFormatterFunction, [duration]);
     }
  },