fabiomsr / moneytextview Goto Github PK
View Code? Open in Web Editor NEWA simple Android TextView to display amounts of money in different formats.
A simple Android TextView to display amounts of money in different formats.
FATAL EXCEPTION: main
Process: com.network.imyth.network, PID: 3373
android.view.InflateException: Binary XML file line #28: Error inflating class org.fabiomsr.moneytextview.MoneyTextView
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:707)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:755)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:758)
at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
at com.network.imyth.network.MainWindow_page_1$RecyclerAdapter.onCreateViewHolder(MainWindow_page_1.java:592)
at android.support.v7.widget.RecyclerView$Adapter.createViewHolder(RecyclerView.java:6367)
at android.support.v7.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:5555)
at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5440)
at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5436)
at android.support.v7.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:2224)
at android.support.v7.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1551)
at android.support.v7.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1511)
at android.support.v7.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:595)
at android.support.v7.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:3583)
at android.support.v7.widget.RecyclerView.dispatchLayout(RecyclerView.java:3312)
at android.support.v7.widget.RecyclerView.onLayout(RecyclerView.java:3844)
at android.view.View.layout(View.java:14840)
at android.view.ViewGroup.layout(ViewGroup.java:4664)
at jp.co.recruit_lifestyle.android.widget.WaveSwipeRefreshLayout.onLayout(WaveSwipeRefreshLayout.java:202)
at android.view.View.layout(View.java:14840)
at android.view.ViewGroup.layout(ViewGroup.java:4664)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1697)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1551)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1460)
at android.view.View.layout(View.java:14840)
at android.view.ViewGroup.layout(ViewGroup.java:4664)
at android.support.v4.view.ViewPager.onLayout(ViewPager.java:1795)
at android.view.View.layout(View.java:14840)
at android.view.ViewGroup.layout(ViewGroup.java:4664)
at android.support.design.widget.HeaderScrollingViewBehavior.layoutChild(HeaderScrollingViewBehavior.java:131)
at android.support.design.widget.ViewOffsetBehavior.onLayoutChild(ViewOffsetBehavior.java:42)
at android.support.design.widget.AppBarLayout$ScrollingViewBehavior.onLayoutChild(AppBarLayout.java:1391)
at android.support.design.widget.CoordinatorLayout.onLayout(CoordinatorLayout.java:870)
at android.view.View.layout(View.java:14840)
at android.view.ViewGroup.layout(ViewGroup.java:4664)
at android.support.v4.widget.DrawerLayout.onLayout(DrawerLayout.java:1193)
at android.view.View.layout(View.java:14840)
at android.view.ViewGroup.layout(ViewGroup.java:4664)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:453)
at android.widget.FrameLayout.onLayout(FrameLayout.java:388)
at android.view.View.layout(View.java:14840)
at android.view.ViewGroup.layout(ViewGroup.java:4664)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1697)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1551)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1460)
at android.view.View.layout(View.java:14840)
at android.view.ViewGroup.layout(ViewGroup.java:4664)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:453)
at android.widget.FrameLayout.onLayout(FrameLayout.java:388)
at android.view.View.layout(View.java:14840)
at android.view.ViewGroup.layout(ViewGroup.java:4664)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1697)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1551)
at android.widget.LinearLayout
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:
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.
This is a question/idea more than an issue. Have you considered (or do you know if it's possible) to implement MoneyTextView using Spans on a single TextView?
HI! i cannot set the fontPath to customize the fontFamily. have you some idea?
Hi, I can't found a pattern, but the calculus of bounds is wrong. Here my code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_height="match_parent">
<org.fabiomsr.moneytextview.MoneyTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:amount="1256.56"
app:gravity="center"
app:symbolTextSize="45sp"
app:decimalDigitsTextSize="45sp"
app:baseTextSize="45sp"
app:decimalSeparator="."
app:symbol="$"/>
<org.fabiomsr.moneytextview.MoneyTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:gravity="center"
app:amount="1.23"
app:symbolTextSize="45sp"
app:decimalDigitsTextSize="45sp"
app:baseTextSize="45sp"
app:decimalSeparator="."
app:symbol="$"/>
<org.fabiomsr.moneytextview.MoneyTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:gravity="center"
app:amount="1.44"
app:symbolTextSize="45sp"
app:decimalDigitsTextSize="45sp"
app:baseTextSize="45sp"
app:decimalSeparator="."
app:symbol="$"/>
</LinearLayout>
I try this with the last version 1.1.0, and this is the result (the integer and symbol section is not aligned with decimal part):
Seems to be no method to change the text in code.
there is a problem when i set a large number,i saw amount is float, when i set number is 123123123123123.123,TextView will show it as a scientific counting method
Ability to change the currency symbol via code
If you use the English or French locale the decimal or the group separator is a comma
The view is cutting the decimal as the height is shorter than expected.
This only happens when we change the alpha on the view
Can't find a proper fix for that weird problem while changing the alpha
Add getAmount method
when I am trying to set ,
app:amount="@{data.totals.subTotal}"
then the issue occurs.
Please do something
Why when i change from the activity the format, the decimal numbers dont appear anymore with the elevation that i have assigned before?, anyone can help me?
minus '-' position coming after symbol if we have negative amount
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.