Git Product home page Git Product logo

Comments (6)

curioustechizen avatar curioustechizen commented on August 12, 2024

Thanks for this report. I'll take a look.

from android-ago.

Winghin2517 avatar Winghin2517 commented on August 12, 2024

Hi,

Did you managed to fix this?

from android-ago.

curioustechizen avatar curioustechizen commented on August 12, 2024

Hi @Winghin2517 I'm sorry I haven't had a chance to look at it yet. The problem seems to be that the UpdateTimeRunnable holds a reference to the View and hence to the Activity. I'm not sure if using an Application Context is the right way to fix it. Instead, I should be attaching and detaching the runnable in the appropriate callback methods.

from android-ago.

Winghin2517 avatar Winghin2517 commented on August 12, 2024

Actually, I'm not sure about the point of this library - you actually don't need this library to tell relative time. Java already does it natively by using the method:http://stackoverflow.com/questions/25174921/time-ago-for-android-java

DateUtils.getRelativeTimeSpanString(long time, long now, long minResolution)

Best to use this method as this library is leaking.

from android-ago.

curioustechizen avatar curioustechizen commented on August 12, 2024

@Winghin2517 This library internally uses the DateUtils class that you mentioned. The README explains this clearly. But the reason to use this library is to automatically call the DateUtils method when the time changes.

For example,

  • suppose it is 10:05 am now. You set the relative time to 10:00 am. So, it shows "5 minutes ago".
  • After a minute, it becomes 10:06 am. But if you use regular DateUtils, you will still be showing "5 minutes ago", which is wrong. It should slow "6 minutes ago".

This library uses a Handler to automatically update the TextView whenever required so that the relative time displayed is always correct.

As to the memory leak, I haven't got time to fix it but contributions are appreciated!

from android-ago.

curioustechizen avatar curioustechizen commented on August 12, 2024

Fixed in v1.3.2. Uploaded to maven central. Will be available .. .eventually ... hopefully.

from android-ago.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.