Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add ability adjust padding on decimal #6

Closed
JefferyEmanuel opened this issue Apr 4, 2017 · 2 comments
Closed

add ability adjust padding on decimal #6

JefferyEmanuel opened this issue Apr 4, 2017 · 2 comments

Comments

@JefferyEmanuel
Copy link

JefferyEmanuel commented Apr 4, 2017

I'd like to adjust the height of the superscript. right now the gravity is just top or bottom . could you make one for center or the ability to add padding so i can push the decimal text down to my specification ? Or can you show me how you got it like this screenshot:
screen shot 2017-04-03 at 11 54 20 pm

because i see thats what i want but your examples dont demo how the decimal part can be perfectly aligned with the dollar part like in that photo.

@fabiomsr
Copy link
Owner

fabiomsr commented Apr 4, 2017

Hi,

You only need to set both symbolGravity and decimalGravity:

        app:symbolGravity="start|top"
        app:decimalGravity="top"

Try this:

<org.fabiomsr.moneytextview.MoneyTextView
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      app:symbol="$"
      app:amount="99.99"

      app:symbolGravity="start|top"
      app:decimalGravity="top"

      app:symbolTextSize="18sp"
      app:baseTextSize="35sp"
      app:decimalDigitsTextSize="18sp"

      app:decimalMargin="6dp"
      app:symbolMargin="6dp"
      app:includeDecimalSeparator="false"
      app:baseTextColor="#FBFFE3"/>

example

@JefferyEmanuel
Copy link
Author

your comments showed me how to do this. the android preview window wasn't updating for some reason but at runtime everything renders fine. excellent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants