anastr / SpeedView

Dynamic Speedometer and Gauge for Android. amazing, powerful, and multi shape :zap:
Apache License 2.0
1.29k stars 324 forks source link

It's make extra Space between SpeedView and my text #189

Closed ghost closed 4 years ago

ghost commented 4 years ago

Make Extra space between com.github.anastr.speedviewlib.SpeedView and Text. How do I remove this extra space

image

XML Code:

<com.github.anastr.speedviewlib.SpeedView
        android:id="@+id/speedometer"
        android:layout_width="160dp"
        android:layout_height="wrap_content"
        app:sv_centerCircleColor="@android:color/transparent"
        app:sv_endDegree="360"
        app:sv_indicator="NeedleIndicator"
        app:sv_indicatorColor="#252525"
        app:sv_markHeight="30dp"
        app:sv_markWidth="6dp"
        app:sv_marksNumber="5"
        app:sv_speedTextFormat="INTEGER"
        app:sv_speedTextPadding="25dp"
        app:sv_speedTextSize="20sp"
        app:sv_speedometerWidth="30dp"
        app:sv_startDegree="180"
        app:sv_textColor="@color/meter_start"
        app:sv_textSize="@dimen/_9sdp"
        app:sv_unit=""
        app:sv_unitUnderSpeedText="true"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/userNameTV"
        android:layout_marginTop="10dp"
        android:layout_marginEnd="@dimen/_15sdp"
        app:sv_withTremble="false"
        />
anastr commented 4 years ago

may you try to remove sv_unitUnderSpeedText="true" and add this tow lines:

app:sv_speedometerMode="TOP"
app:sv_cutPadding="40dp"

update

then change cutPadding to what you like.

ghost commented 4 years ago

Okay great this is working. But have you notice 0 and 100 text position is not in the center. @anastr

anastr commented 4 years ago

Mostly that cannot be fixed.