Skip to content

Commit

Permalink
Some more updates to README and gradle properties for publishing to M…
Browse files Browse the repository at this point in the history
…aven Central
  • Loading branch information
curioustechizen committed Apr 2, 2017
1 parent 72f5031 commit 61037d1
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 21 deletions.
29 changes: 11 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.

Expand All @@ -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

Expand All @@ -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`.
Expand All @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion android-ago/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ android {
}
}

//apply from: 'maven-publish.gradle'
apply from: 'maven-publish.gradle'
4 changes: 2 additions & 2 deletions android-ago/gradle.properties
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 61037d1

Please sign in to comment.