All Projects → Perfomer → Blitz

Perfomer / Blitz

Licence: apache-2.0
Android Library: Set self-updating string with relative time in TextView (e.g. 5 minutes ago)

Programming Languages

kotlin
9241 projects

Projects that are alternatives of or similar to Blitz

Calendar
📅 PHP Date & Time library that solves common problems in object oriented, immutable way.
Stars: ✭ 113 (-47.93%)
Mutual labels:  time, datetime
Delorean
Delorean: Time Travel Made Easy
Stars: ✭ 1,793 (+726.27%)
Mutual labels:  time, datetime
Human time
Ruby time and date comparisons for humans
Stars: ✭ 113 (-47.93%)
Mutual labels:  time, datetime
Luatz
Time, Date and Timezone library for lua
Stars: ✭ 92 (-57.6%)
Mutual labels:  time, datetime
Time
Building a better date/time library for Swift
Stars: ✭ 1,983 (+813.82%)
Mutual labels:  time, datetime
Dateparse
GoLang Parse many date strings without knowing format in advance.
Stars: ✭ 1,365 (+529.03%)
Mutual labels:  time, datetime
Tail.datetime
A lightweight, translat- and configurable Open Source DateTime Picker, written in pure vanilla JavaScript!
Stars: ✭ 139 (-35.94%)
Mutual labels:  time, datetime
When
A natural language date/time parser with pluggable rules
Stars: ✭ 1,113 (+412.9%)
Mutual labels:  time, datetime
Gostradamus
Gostradamus: Better DateTimes for Go 🕰️
Stars: ✭ 148 (-31.8%)
Mutual labels:  time, datetime
Date Picker
📅 Custom responsive date picker widget for Android, written in Kotlin.
Stars: ✭ 146 (-32.72%)
Mutual labels:  time, datetime
Graphql Java Datetime
GraphQL ISO Date is a set of RFC 3339 compliant date/time scalar types to be used with graphql-java.
Stars: ✭ 89 (-58.99%)
Mutual labels:  time, datetime
Date
A date and time library based on the C++11/14/17 <chrono> header
Stars: ✭ 2,389 (+1000.92%)
Mutual labels:  time, datetime
Carbon
A simple PHP API extension for DateTime
Stars: ✭ 75 (-65.44%)
Mutual labels:  time, datetime
Time Stamp
Get a formatted timestamp. Used in gulp, assemble, generate, and many others.
Stars: ✭ 104 (-52.07%)
Mutual labels:  time, datetime
Iso8601
Ruby parser to work with ISO8601 dateTimes and durations — http://en.wikipedia.org/wiki/ISO_8601
Stars: ✭ 70 (-67.74%)
Mutual labels:  time, datetime
Dateutil
Useful extensions to the standard Python datetime features
Stars: ✭ 1,706 (+686.18%)
Mutual labels:  time, datetime
Zulu
A drop-in replacement for native Python datetimes that embraces UTC.
Stars: ✭ 52 (-76.04%)
Mutual labels:  time, datetime
Laydate
layDate(日期与时间组件) 是 layui 独立维护的三大组件之一
Stars: ✭ 1,066 (+391.24%)
Mutual labels:  time, datetime
Exceptionless.datetimeextensions
DateTimeRange, Business Day and various DateTime, DateTimeOffset, TimeSpan extension methods
Stars: ✭ 142 (-34.56%)
Mutual labels:  time, datetime
Eztime
ezTime — pronounced "Easy Time" — is a very easy to use Arduino time and date library that provides NTP network time lookups, extensive timezone support, formatted time and date strings, user events, millisecond precision and more.
Stars: ✭ 173 (-20.28%)
Mutual labels:  time, datetime

blitz

GitHub license

blitz is a very lightweight Android library that allows you to set a self-updating string with relative time in TextView in just one line of code.

DOESN'T require using custom TextView.

It will not overheadly update your TextView: e.g. if your relative time is 5 minutes ago then blitz will send update only after one minute, not every second. The same with others time units: hours updates once an hour, etc.

Don't be scared to use it in your ViewHolders, 'cause blitz won't let anything leak and will take care of the system resources.

Briefly usage:

val myTextView: TextView = ...
val eventTime: Long = ...

// just one line of code and that is it!
myTextView.setTimeAgo(eventTime)

Languages support:

There's not your language? You can help the community by sending a Pull Request.

Installation:

Step 1

Add repository to your gradle.build file (project)

allprojects {
  repositories {
    maven { url 'https://jitpack.io' }
  }
}

Step 2

Add dependency to your gradle.build file (app) or other module

dependencies {
   implementation 'com.github.perfomer:blitz:LATEST_VERSION'
}

See the latest release version here: .

Usage:

TextView

If you want to set the self-updating string with relative time direct into the TextView then use extesnsion method:

myTextView.setTimeAgo(eventTime)

You can also customize it a bit:

myTextView.setTimeAgo(
  // Can be Long or java.util.Date
  time = eventTime,
  
  // If [true]: Show the exact seconds count if time difference is less than minute 
  // Or if [false]: Show "just now" message in that case.
  showSeconds = true, 
  
  // Don't want auto-update? Just set it to false.
  autoUpdate = false 
)

If you don't want to get time updates more than use cancel method:

myTextView.cancelTimeAgoUpdates()

String

If you just want to get a time-relative string, then you can use the following extension methods:

val contextString: String = context.getTimeAgo(time = eventTime, showSeconds = false)
val resourcesString: String = resources.getTimeAgo(time = eventTime, showSeconds = false)

Communication:

License:

Apache 2.0 LICENSE

Copyright (c) 2020 Denis Balchugov.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].