Confused with elements sizing in Kivy
<p>I've just started to learn Kivy and confused with elements sizing. Let's say I want to create video player time bar with progress bar in middle and time labels on sides.</p>

<p>What I got so far:</p>

<pre><code>&lt;TimeLabel@Label&gt;:
    width: 100
    padding: 10, 0
    font_size: '14sp'


&lt;Player&gt;:
    BoxLayout:
        orientation: 'horizontal'
        pos: 0, 0
        size: root.width, 40

        canvas:
            Color:
                rgba: 0, 0.5, 0, 0.8
            Rectangle:
                pos: self.pos
                size: self.size

        TimeLabel:
            size_hint: None, 1
            text: "0"

        ProgressBar:
            value_normalized: 0.5

        TimeLabel:
            size_hint: None, 1
            text: "10:00:00"
</code></pre>

<p>On Windows everything seems to be ok:</p>

<p><a href="http://i.stack.imgur.com/vahKN.png" rel="nofollow"><img src="http://i.stack.imgur.com/vahKN.png" alt="enter image description here"></a></p>

<p>While on my Galaxy S4 not:</p>

<p><a href="http://i.stack.imgur.com/vao2E.png" rel="nofollow"><img src="http://i.stack.imgur.com/vao2E.png" alt="enter image description here"></a></p>

<p>As you see on last screenshot tab too is low and progress bar ran into time label. Of cause I can increase bar height and labels width, but in this case all this would be too big on Windows.</p>

<p>How can I fix sizes on Android saving current proportions on Windows? </p>

<p>Never ever use default pixel sizing for your widgets, like you did in several places. Use either size hint, or dp unit. This way, your UI will look the same everywhere. More info <a href="https://kivy.org/docs/api-kivy.metrics.html" rel="nofollow">here</a>.</p>

python kivy kivy-language