Comments (6)
@abdulmalekDery With the current implementation this is not possible. That's because this library does not generate the "16 min ago" string - it just uses Android's DateUtils
class to get that string. The point of this library is to automatically refresh the text when the time changes.
Also, note that this string will be different depending on the locale.
Having said that, I am willing to explore making the library more flexible such that users have more control over how to display the String. Then, the role of RTTV will be reduced to just auto-refreshing the UI when the time changes, and leaving the exact formatting of the string to the user.
I don't promise anything but I'll look into it.
from android-ago.
@abdulmalekDery Of course, but the point is that the code you shared should be written by the library user. The library should provide a hook for the calling code to customize the text being displayed. It does not make sense to include this code in the library itself.
from android-ago.
@curioustechizen yeah ....I 'm just telling the other users how they could remove that word
from android-ago.
@abdulmalekDery Great idea. Maybe until I get time to improve the API, I should start a "Recipes" section in the wiki where users who have found such solutions can contribute.
from android-ago.
@abdulmalekDery v1.4.0 has been released with a new feature that allows you to process the relative time string before it is displayed. This can be used to achieve the behaviour you requested - i.e. trimming certain strings before displaying.
Please try out 1.4.0. I'm closing this issue in the meanwhile.
from android-ago.
@curioustechizen Thank you so much
but I think we can remove that word "ago" with a simple hack "I wish we could do that"
because this DataUtils return that String "for example the name of that String is s" we could simply call this methods
if(s.contains(getString(R.string.ago)))
s=s.replace(getString(R.string.ago),"");
I wish this could help
from android-ago.
Related Issues (20)
- Time ago calculation HOT 13
- Strings in Portuguese
- in 0 mins HOT 14
- Now LATEST_VERSION is what ? HOT 2
- Lack of consistent capitalization (English) HOT 3
- A String Completed added prior to time HOT 3
- Once the `UpdateTimeRunnable` is detached and the `weakRefRttv` cleared, it is never attached again HOT 4
- Add automated tests HOT 4
- Change lang of "hours ago" ... HOT 1
- Locale HOT 1
- Time is one hour behind on old Galaxy Tab 3 using Android 4.4.2 HOT 3
- add font family option HOT 6
- this work fine in recyclerviews? HOT 1
- Save timeago when close the app HOT 1
- Add a `getReferenceTime()` method
- Modify time update interval HOT 1
- Text format has extra charcters in it HOT 2
- Enhancement - short suffix HOT 1
- In new update, issue with Just Now
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from android-ago.