talalmajali / react-native-countdown-component

React Native CountDown
MIT License
271 stars 234 forks source link

Timer not Proper Showing #13

Closed Biplovkumar closed 5 years ago

Biplovkumar commented 5 years ago

only one digit is showing in minutes and second. screenshot_20180916-210353

talalmajali commented 5 years ago

@Biplovkumar What is the model of the device?

Biplovkumar commented 5 years ago

Android device One plus 5t . Sorry for late reply.

Biplovkumar commented 5 years ago

Any update ?

talalmajali commented 5 years ago

@Biplovkumar is this happening on a specific countdown component size? What's the size that are you using here? and can you make sure that the device font size (in settings) is set to default?

Biplovkumar commented 5 years ago

@talalmajali

  1. Size:- height/40
  2. device font size:- default Code :- const SCREEN_HEIGHT = Dimensions.get('window').height;

                 <CountDown
                    //  style = {{width: 200 ,height: 100}}
                    timeToShow={['M', 'S']}
                    digitTxtColor={'rgba(251, 116, 0,0.8)'}
                    timeTxtColor={'rgba(255,165,0,0.5)'}
                    digitBgColor={'rgba(0,0,0,0.1)'}
                    until={this.state.timelimit}
                    onFinish={() => { this.state.type === "essay" ? console.log("Sorry No timer") : this.handleQuizSubmit() }}
                    size={SCREEN_HEIGHT / 40}
                  />
talalmajali commented 5 years ago

@Biplovkumar i ran the same code on same device (1080 x 2160 pixels) screen OnePlus 5T and it's showing without any problems, it's not screen scaling problem, i think what u meant to say that the minutes and seconds should have leading zero before each of them, so in the image the timer should be rendered as 01 05, right?

samybenatt commented 5 years ago

Hi,

This problem is common on OnePlus phones and related to React Native. Here is the RN issue : https://github.com/facebook/react-native/issues/15114

Common fixes for this issue :

You have all the other possible solutions on the link above.

Tested on my device and it worked !

Biplovkumar commented 5 years ago

@samay ,thanks this is the solution.