diff --git a/README.md b/README.md index 2409389..92fe195 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,4 @@ -android-ago -========== +# android-ago This library provides `RelativeTimeTextView`, a custom `TextView` that takes a reference time and always displays the relative time with respect to the reference point, **automatically refreshing the display text as needed**. This is a common pattern seen in several apps like chat apps, social networking, email etc. @@ -8,10 +7,9 @@ This library provides `RelativeTimeTextView`, a custom `TextView` that takes a r This library can be seen as a wrapper on top of the excellent `android.text.format.DateUtils` class. Note that the library does _not_ expose all the options provided by the `DateUtils` class. I have left out many features because I couldn't decide what would be the best way to achieve the flexibility - dozens of XML attributes? Contributions in this regard are welcome. -Obtaining -========= +# Obtaining -###Gradle +### Gradle Add the following to your build.gradle @@ -20,13 +18,12 @@ Add the following to your build.gradle } -###Eclipse+ADT +### Eclipse+ADT 1. Clone the repo 2. In Eclipse, go to `File` -> `New` -> `Other`. Expand `Android` and select `Android Project from Existing Code` 3. Browse to the `android-ago` sub-folder of the cloned repo and hit `Finish` -Usage -===== +# Usage - Include `RelativeTimeTextView` in your layouts. - Set the reference time either using `setReferenceTime` method or using the XML attribute `reference_time`. @@ -52,36 +49,32 @@ v.setReferenceTime(new Date().getTime()); See the sample project for a concrete example. -Why is this library even needed? -====== +## Why is this library even needed? One might ask, why not just use `DateUtils` directly? Well, the answer is that the custom `TextView` provided by this library is responsible for keeping track of its own reference time and of updating the display text over regular periodic intervals. It is also responsible for scheduling (or cancelling a scheduled) update of the display text. All you have to do is set the reference time once. -Who's Using this Library? -======== +## Who's Using this Library? See [here](https://github.com/curioustechizen/android-ago/wiki/Apps-using-android-ago). If you would like to add your app to this list, please edit the wiki. -Android version support statement -======== +## Android version support statement The library has been tested on API 11 and above. However, theoretically, it works on API 3 and above since all it uses is [DateUtils#getRelativeTimeSpanString](http://developer.android.com/reference/android/text/format/DateUtils.html#getRelativeTimeSpanString(long, long, long, int)). The minSdkVersion has been set to 8, however do not expect support from me for API version < 11. -Usage with Data Binding -======== +# Usage with Data Binding See `android-ago-sample-databinding` for an example of how to use this library with the Android data binding library. Thanks to @Dev-IL for providing this sample. -###License +### License - Copyright 2016 Kiran Rao + Copyright 2017 Kiran Rao Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/android-ago/build.gradle b/android-ago/build.gradle index 87401bb..e28b49d 100644 --- a/android-ago/build.gradle +++ b/android-ago/build.gradle @@ -19,4 +19,4 @@ android { } } -//apply from: 'maven-publish.gradle' \ No newline at end of file +apply from: 'maven-publish.gradle' \ No newline at end of file diff --git a/android-ago/gradle.properties b/android-ago/gradle.properties index 3f84786..fc8d9ea 100644 --- a/android-ago/gradle.properties +++ b/android-ago/gradle.properties @@ -1,8 +1,8 @@ POM_NAME=android-ago Library POM_ARTIFACT_ID=library POM_PACKAGING=aar -VERSION_NAME=1.3.1 -VERSION_CODE=10301 +VERSION_NAME=1.3.3 +VERSION_CODE=10303 GROUP=com.github.curioustechizen.android-ago POM_DESCRIPTION=An Android TextView that always displays an auto refreshing relative time span with respect to a reference time