├── screenshot.png ├── tachyon ├── gradle.properties ├── src │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── res │ │ │ └── values │ │ │ │ └── attrs.xml │ │ └── java │ │ │ └── com │ │ │ └── linkedin │ │ │ └── android │ │ │ └── tachyon │ │ │ ├── DirectionalRect.java │ │ │ └── DayView.java │ └── test │ │ └── java │ │ └── com │ │ └── linkedin │ │ └── android │ │ └── tachyon │ │ └── DayViewTest.java └── build.gradle ├── settings.gradle ├── .gitignore ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── tachyon-sample ├── src │ └── main │ │ ├── res │ │ ├── values │ │ │ ├── integers.xml │ │ │ ├── colors.xml │ │ │ ├── styles.xml │ │ │ ├── dimens.xml │ │ │ └── strings.xml │ │ └── layout │ │ │ ├── hour_label.xml │ │ │ ├── event.xml │ │ │ ├── scroll_target_dialog.xml │ │ │ ├── sample_activity.xml │ │ │ └── edit_event_dialog.xml │ │ ├── AndroidManifest.xml │ │ └── java │ │ └── com │ │ └── linkedin │ │ └── android │ │ └── tachyon │ │ └── sample │ │ └── SampleActivity.java ├── proguard-rules.pro └── build.gradle ├── CHANGELOG.md ├── .travis.yml ├── gradle.properties ├── NOTICE ├── README.md ├── RELEASING.md ├── CONTRIBUTING.md ├── LICENSE ├── gradlew.bat └── gradlew /screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linkedin/Tachyon/HEAD/screenshot.png -------------------------------------------------------------------------------- /tachyon/gradle.properties: -------------------------------------------------------------------------------- 1 | POM_NAME=Tachyon 2 | POM_ARTIFACT_ID=tachyon 3 | POM_PACKAGING=aar -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = "tachyon-root" 2 | include ':tachyon', ':tachyon-sample' 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .gradle 2 | local.properties 3 | .idea/ 4 | build/ 5 | .DS_Store 6 | *.iml 7 | *.ipr 8 | *.iws 9 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linkedin/Tachyon/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /tachyon/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /tachyon-sample/src/main/res/values/integers.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 0 4 | 24 5 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Sat Nov 10 11:59:22 PST 2018 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip 7 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | Change Log 2 | ========== 3 | 4 | 1.0.2 *(2019-06-13)* 5 | -------------------------- 6 | * Support custom start and end hours 7 | 8 | 1.0.1 *(2019-04-14)* 9 | -------------------------- 10 | * Adding top and bottom position methods for hours and events 11 | 12 | 1.0.0 *(2019-03-31)* 13 | -------------------------- 14 | * Initial release 15 | -------------------------------------------------------------------------------- /tachyon-sample/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | #b0b0b0 9 | #e0e0e0 10 | 11 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: android 2 | jdk: oraclejdk8 3 | 4 | # See https://github.com/travis-ci/travis-ci/issues/5582 5 | sudo: required 6 | 7 | android: 8 | components: 9 | # https://github.com/travis-ci/travis-ci/issues/6040#issuecomment-219367943 10 | - tools 11 | - tools 12 | 13 | - platform-tools 14 | - android-28 15 | - build-tools-28.0.3 16 | - extra-android-m2repository 17 | - extra-android-support 18 | 19 | script: './gradlew clean build' 20 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Library info 2 | VERSION_NAME=1.0.2-SNAPSHOT 3 | GROUP_ID=com.linkedin.android.tachyon 4 | LIBRARY_NAME=Tachyon 5 | LIBRARY_DESCRIPTION=Provides a calendar day view on Android. 6 | LIBRARY_GIT_URL=https://github.com/linkedin/Tachyon 7 | LIBRARY_GIT_CONNECTION=git@github.com:linkedin/Tachyon.git 8 | ARTIFACT=tachyon 9 | 10 | # Gradle settings 11 | org.gradle.daemon=true 12 | org.gradle.configureondemand=false 13 | org.gradle.parallel=true 14 | 15 | #For AndroidX migration 16 | android.useAndroidX=true 17 | android.enableJetifier=true -------------------------------------------------------------------------------- /tachyon-sample/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 13 | 14 | -------------------------------------------------------------------------------- /NOTICE: -------------------------------------------------------------------------------- 1 | Copyright 2019 LinkedIn Corporation 2 | All Rights Reserved. 3 | 4 | Licensed under the BSD 2-Clause License (the "License"). See License in the 5 | project root for license information. 6 | 7 | Please note, this project may automatically load third party code from external 8 | repositories. If so, such third party code may be subject to other license terms 9 | than as set forth above. In addition, such third party code may also depend on 10 | and load multiple tiers of dependencies. Please review the applicable licenses 11 | of the additional dependencies. 12 | 13 | This product includes/uses Gradle (http://gradle.org/) 14 | Copyright (C) 2019 Gradle Inc. 15 | License: Apache 2.0 16 | -------------------------------------------------------------------------------- /tachyon-sample/src/main/res/layout/hour_label.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /tachyon-sample/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 1dp 9 | 5dp 10 | 10dp 11 | 1dp 12 | 50dp 13 | 65dp 14 | 52dp 15 | 85dp 16 | 4dp 17 | -------------------------------------------------------------------------------- /tachyon-sample/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | *This project is no longer maintained.* 2 | 3 | Tachyon 4 | ======== 5 | 6 | An Android library that provides a customizable calendar day view. 7 | 8 | [Click here for the iOS version.](https://github.com/linkedin/Tachyon-iOS) 9 | 10 | ![Alt text](screenshot.png "Tachyon Sample") 11 | 12 | Tachyon is designed to provide a familiar visualization of a calendar day. The rendering is done by the `DayView` class, which takes a list of events and displays them using a custom layout algorithm. 13 | 14 | Usage 15 | ----- 16 | 17 | To use Tachyon, you can either directly reference the `DayView` class in your layout files/code, or you can subclass `DayView` to customize the experience. 18 | 19 | Sample App 20 | ---------- 21 | 22 | The ''tachyon-sample'' app contains an example of using the library. 23 | 24 | Testing 25 | ------- 26 | 27 | We use Mockito for our unit tests. You can run them via the `clean test` Gradle tasks. 28 | -------------------------------------------------------------------------------- /tachyon-sample/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion rootProject.ext.compileSdkVersion 5 | buildToolsVersion rootProject.ext.buildToolsVersion 6 | 7 | defaultConfig { 8 | minSdkVersion rootProject.ext.minSdkVersion 9 | targetSdkVersion rootProject.ext.targetSdkVersion 10 | versionCode 1 11 | versionName VERSION_NAME 12 | } 13 | 14 | compileOptions { 15 | sourceCompatibility rootProject.ext.javaVersion 16 | targetCompatibility rootProject.ext.javaVersion 17 | } 18 | 19 | buildTypes { 20 | release { 21 | minifyEnabled false 22 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' 23 | } 24 | } 25 | } 26 | 27 | dependencies { 28 | implementation project(':tachyon') 29 | implementation "androidx.appcompat:appcompat:1.0.2" 30 | } -------------------------------------------------------------------------------- /tachyon/src/main/res/values/attrs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /RELEASING.md: -------------------------------------------------------------------------------- 1 | Releasing 2 | ======== 3 | 4 | 1. Change the version in `gradle.properties` to a non-SNAPSHOT version. 5 | 2. Update the `CHANGELOG.md` for the impending release. 6 | 3. Update the `README.md` with the new version. 7 | 4. `git commit -am "Prepare for release X.Y.Z."` (where X.Y.Z is the new version) 8 | 5. `git tag -a X.Y.Z -m "Version X.Y.Z"` (where X.Y.Z is the new version) 9 | 6. `./gradlew clean bintrayUpload` 10 | 7. Update the `gradle.properties` to the next SNAPSHOT version. 11 | 8. `git commit -am "Prepare next development version."` 12 | 9. `git push && git push --tags` 13 | 14 | 15 | Prerequisites 16 | ------------- 17 | 18 | First, you will need a Bintray account with access to the [linkedin-tachyon](https://bintray.com/linkedin-tachyon) organization. 19 | 20 | Then, set the following environment variables: 21 | 22 | * `BINTRAY_USER` - Bintray username 23 | * `BINTRAY_KEY` - Bintray API key for the given user account 24 | -------------------------------------------------------------------------------- /tachyon-sample/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 8 | 9 | 13 | 14 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | Contribution Agreement 2 | ====================== 3 | 4 | As a contributor, you represent that the code you submit is your original work or that of your employer (in which case you represent you have the right to bind your employer). By submitting code, you (and, if applicable, your employer) are licensing the submitted code to LinkedIn and the open source community subject to the BSD 2-Clause license. 5 | 6 | Contributing 7 | ============ 8 | 9 | If you would like to contribute to Tachyon you can do so through Github by forking the repository and sending a pull request. 10 | 11 | When submitting code, please make every effort to follow existing conventions and style in order to keep the code as readable as possible. 12 | 13 | Bugs 14 | ==== 15 | 16 | Please [create an issue](https://github.com/linkedin/tachyon/issues/new) and include enough information to reproduce the issue you are seeing. Be sure to include which Android version you're using as well. 17 | 18 | Feature requests 19 | ================ 20 | 21 | Please [create an issue](https://github.com/linkedin/tachyon/issues/new) to describe the feature and why you think it would be useful. 22 | 23 | Reporting security issues 24 | ========================= 25 | 26 | Please report security issues to [security@linkedin.com](mailto:security@linkedin.com) with a subject line of this format: 27 | 28 | `GitHub linkedin/tachyon - [summary of issue]` -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | BSD 2-CLAUSE LICENSE 2 | 3 | Copyright 2019 LinkedIn Corporation 4 | All Rights Reserved. 5 | 6 | Redistribution and use in source and binary forms, with or 7 | without modification, are permitted provided that the following 8 | conditions are met: 9 | 10 | 1. Redistributions of source code must retain the above copyright 11 | notice, this list of conditions and the following disclaimer. 12 | 13 | 2. Redistributions in binary form must reproduce the above 14 | copyright notice, this list of conditions and the following 15 | disclaimer in the documentation and/or other materials provided 16 | with the distribution. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /tachyon-sample/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Tachyon Sample 9 | Previous Day 10 | Next Day 11 | Add Event 12 | Edit Event 13 | Scroll To… 14 | Title 15 | Location 16 | Date 17 | Start Time 18 | End Time 19 | Color 20 | Delete 21 | Time… 22 | First Event Top 23 | First Event Bottom 24 | Last Event Top 25 | Last Event Bottom 26 | 27 | -------------------------------------------------------------------------------- /tachyon-sample/src/main/res/layout/event.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 14 | 15 | 27 | 28 | 40 | 41 | -------------------------------------------------------------------------------- /tachyon/src/main/java/com/linkedin/android/tachyon/DirectionalRect.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 LinkedIn Corporation 3 | * All Rights Reserved. 4 | * 5 | * Licensed under the BSD 2-Clause License (the "License"). See License in the project root for 6 | * license information. 7 | */ 8 | package com.linkedin.android.tachyon; 9 | 10 | /** 11 | * Similar to {@link android.graphics.Rect} but provides the 12 | * {@link #set(boolean, int, int, int, int, int)} method to handle right-to-left mode. 13 | */ 14 | public class DirectionalRect { 15 | 16 | private int left; 17 | private int top; 18 | private int right; 19 | private int bottom; 20 | 21 | /** 22 | * Sets the rect's points but factors in whether or not the device is in right-to-left mode. 23 | * 24 | * @param isRtl whether or not the device is in right-to-left mode 25 | * @param parentWidth the width of the parent view of the rect, this will be used to figure out 26 | * how to translate 27 | * the rect in right-to-left mode 28 | * @param start the start of the rect in left-to-right mode 29 | * @param top the top of the rect, it will not be translated 30 | * @param end the end of the rect in left-to-right mode 31 | * @param bottom the bottom of the rect, it will not be translated 32 | */ 33 | public void set(boolean isRtl, int parentWidth, int start, int top, int end, int bottom) { 34 | this.left = isRtl ? parentWidth - end : start; 35 | this.top = top; 36 | this.right = isRtl ? parentWidth - start : end; 37 | this.bottom = bottom; 38 | } 39 | 40 | public int getLeft() { 41 | return left; 42 | } 43 | 44 | public int getTop() { 45 | return top; 46 | } 47 | 48 | public int getRight() { 49 | return right; 50 | } 51 | 52 | public int getBottom() { 53 | return bottom; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /tachyon-sample/src/main/res/layout/scroll_target_dialog.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 13 | 14 |