A smart colored time selector. Users can select just free time with a handy colorful range selector.

Overview

Download Android Arsenal GitHub license Build Status

Colored Time Range Selector

A smart colored time range selector. Users can select just free time with a handy colorful range selector.

Screen Shots

Colored Time Range Bar Selector

Colored Time Range Bar Selector

Features

  • Select a time range between 2 hours
  • Highlight available time range with your desire color
  • Select just free times in a range
  • Two different type of view, with Selector and without it

Use it

build.gradle

dependencies {
    implementation 'de.ehsun.coloredtimebar:coloredtimebar:1.0'
}

In your layout use the ColoredTimeBar as below:

<de.ehsun.coloredtimebar.TimelineView
            android:id="@+id/timelineView"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:barColorAvailable="@color/available_time_default_color"
            app:barColorHighlight="@color/selector_default_color"
            app:barColorNotAvailable="@color/timeline_default_color"
            app:barWidth="16dp"
            app:fractionLineColor="@color/separatorDark"
            app:fractionLineLength="8dp"
            app:fractionLineWidth="1dp"
            app:fractionPrimaryTextColor="@color/fraction_default_color"
            app:fractionSecondaryTextColor="@color/fraction_default_color"
            app:fractionTextInterval="2"
            app:fractionTextSize="8sp"
            app:timeRange="07:00-19:00" />

In your code you can easily set the available time by passing an array of time range string as below:

timelineView.setAvailableTimeRange(listOf("07:00 - 10:15", "12:00 - 15:00"))

And to enable picker handles use it as below:

<de.ehsun.coloredtimebar.TimelinePickerView
                android:id="@+id/timelinePicker"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                app:barColorAvailable="@color/available_time_default_color"
                app:barColorHighlight="@color/selector_default_color"
                app:barColorNotAvailable="@color/timeline_default_color"
                app:barWidth="24dp"
                app:fractionLineColor="@color/separatorDark"
                app:fractionLineLength="8dp"
                app:fractionLineWidth="1dp"
                app:fractionPrimaryTextColor="@color/colorGrey900"
                app:fractionSecondaryTextColor="@color/colorBlueGrey500"
                app:fractionTextInterval="1"
                app:fractionTextSize="8sp"
                app:stepSize="15"
                app:timeRange="07:00-19:00" />
timelinePicker.setOnSelectedTimeRangeChangedListener { from, to ->
            selectedTimeTextView.text = getString(R.string.from_to, from.format(), to.format())
        }

Colored Time Range Bar Selector

Do you like it?

Use it and develop it as you like and buy me a cup of tea :)

Buy Me a Coffee at ko-fi.com

You might also like...
Vigour - An Android Fitness App that rewards users with Crypto for walking a certain amount of steps.

Vigour Group Project for 2022 Mobile Application Development. Our app rewards user with crypto after walking for a certain amount of steps. We will be

A simple e-market application that allows users to view the store details and products, add products to the basket, and place an order.
A simple e-market application that allows users to view the store details and products, add products to the basket, and place an order.

E-Market Application Features : Store details & products screen Fetch the store detail from an endpoint and display this upper part of the screen. Fet

UserLoc - A API call using Retrofit to obtain list of users details and show on UI in recycler view and google map
UserLoc - A API call using Retrofit to obtain list of users details and show on UI in recycler view and google map

UserLoc This uses a API call using Retrofit to obtain list of users details and

This sample Kotlin app shows a list of custom shoes added by the users

Shoe-store This sample Kotlin app shows a list of custom shoes added by the users. The app displays the content with RecyclerView and uses a tradition

WorkManager ,One time,Sequential Execution, Periodic time Execution

WokManagerSample WorkManager ,One time,Sequential Execution, Periodic time Execu

A Kotlin library for reactive and boilerplate-free SharedPreferences in Android
A Kotlin library for reactive and boilerplate-free SharedPreferences in Android

KPreferences A Kotlin library for reactive and boilerplate-free Shared Preferences in Android. With KPreferences you can use Kotlin's marvelous delega

Unofficial Android client for dev.to. Open source and free

Dev.to Android by Android Broadcast Unofficial Android client for dev.to Technologies Kotlin Gradle Kotlin DSL Kotlin Coroutines OkHttp + Retrofit kot

Free & Open-Source External Scripting Platform
Free & Open-Source External Scripting Platform

LeagueOfJire Free & Open-Source External Scripting Platform What features does this have? All of the feature's source-code can be found in the userscr

Disk Usage/Free Utility - a better 'df' alternative
Disk Usage/Free Utility - a better 'df' alternative

duf Disk Usage/Free Utility (Linux, BSD, macOS & Windows) Features User-friendly, colorful output Adjusts to your terminal's theme & width Sort the re

Comments
  • ndroid.view.InflateException: Binary XML file line #11: Error inflating class de.ehsun.coloredtimebar.TimelineView

    ndroid.view.InflateException: Binary XML file line #11: Error inflating class de.ehsun.coloredtimebar.TimelineView

    Hello im getting following error will you please help me out to fix it if m doing something wrong

    04-15 14:17:04.421 1247-1247/net.aafushh.smoky E/AndroidRuntime: FATAL EXCEPTION: main Process: net.aafushh.smoky, PID: 1247 java.lang.RuntimeException: Unable to start activity ComponentInfo{net.aafushh.smoky/net.aafushh.smoky.booking.test}: android.view.InflateException: Binary XML file line #11: Error inflating class de.ehsun.coloredtimebar.TimelineView at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2292) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2350) at android.app.ActivityThread.access$800(ActivityThread.java:163) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1257) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:157) at android.app.ActivityThread.main(ActivityThread.java:5335) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1265) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1081) at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:132) at dalvik.system.NativeStart.main(Native Method) Caused by: android.view.InflateException: Binary XML file line #11: Error inflating class de.ehsun.coloredtimebar.TimelineView at android.view.LayoutInflater.createView(LayoutInflater.java:626) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:702) at android.view.LayoutInflater.rInflate(LayoutInflater.java:761) at android.view.LayoutInflater.inflate(LayoutInflater.java:498) at de.robv.android.xposed.XposedBridge.invokeOriginalMethodNative(Native Method) at de.robv.android.xposed.XposedBridge.handleHookedMethod(XposedBridge.java:631) at android.view.LayoutInflater.inflate(Native Method) at android.view.LayoutInflater.inflate(LayoutInflater.java:398) at android.view.LayoutInflater.inflate(LayoutInflater.java:354) at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:287) at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:139) at net.aafushh.smoky.booking.test.onCreate(test.java:13) at android.app.Activity.performCreate(Activity.java:5389) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2256) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2350)  at android.app.ActivityThread.access$800(ActivityThread.java:163)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1257)  at android.os.Handler.dispatchMessage(Handler.java:102)  at android.os.Looper.loop(Looper.java:157)  at android.app.ActivityThread.main(ActivityThread.java:5335)  at java.lang.reflect.Method.invokeNative(Native Method)  at java.lang.reflect.Method.invoke(Method.java:515)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1265)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1081)  at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:132)  at dalvik.system.NativeStart.main(Native Method)  Caused by: java.lang.reflect.InvocationTargetException at java.lang.reflect.Constructor.constructNative(Native Method) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at android.view.LayoutInflater.createView(LayoutInflater.java:600) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:702)  at android.view.LayoutInflater.rInflate(LayoutInflater.java:761)  at android.view.LayoutInflater.inflate(LayoutInflater.java:498)  at de.robv.android.xposed.XposedBridge.invokeOriginalMethodNative(Native Method)  at de.robv.android.xposed.XposedBridge.handleHookedMethod(XposedBridge.java:631)  at android.view.LayoutInflater.inflate(Native Method)  at android.view.LayoutInflater.inflate(LayoutInflater.java:398)  at android.view.LayoutInflater.inflate(LayoutInflater.java:354)  at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:287)  at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:139)  at net.aafushh.smoky.booking.test.onCreate(test.java:13)  at android.app.Activity.performCreate(Activity.java:5389)  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2256)  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2350)  at android.app.ActivityThread.access$800(ActivityThread.java:163)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1257)  at android.os.Handler.dispatchMessage(Handler.java:102)  at android.os.Looper.loop(Looper.java:157)  at android.app.ActivityThread.main(ActivityThread.java:5335)  at java.lang.reflect.Method.invokeNative(Native Method)  at java.lang.reflect.Method.invoke(Method.java:515)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1265)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1081)  at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:132)  at dalvik.system.NativeStart.main(Native Method)  Caused by: java.lang.NoSuchMethodError: android.view.View.<init> at de.ehsun.coloredtimebar.TimelineView.<init>(TimelineView.kt:15) at de.ehsun.coloredtimebar.TimelineView.<init>(TimelineView.kt:14) at de.ehsun.coloredtimebar.TimelineView.<init>(TimelineView.kt) at java.lang.reflect.Constructor.constructNative(Native Method)  at java.lang.reflect.Constructor.newInstance(Constructor.java:423)  at android.view.LayoutInflater.createView(LayoutInflater.java:600)  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:702)  at android.view.LayoutInflater.rInflate(LayoutInflater.java:761)  at android.view.LayoutInflater.inflate(LayoutInflater.java:498)  at de.robv.android.xposed.XposedBridge.invokeOriginalMethodNative(Native Method)  at de.robv.android.xposed.XposedBridge.handleHookedMethod(XposedBridge.java:631)  at android.view.LayoutInflater.inflate(Native Method)  at android.view.LayoutInflater.inflate(LayoutInflater.java:398)  at android.view.LayoutInflater.inflate(LayoutInflater.java:354)  at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:287)  at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:139)  at net.aafushh.smoky.booking.test.onCreate(test.java:13)  at android.app.Activity.performCreate(Activity.java:5389)  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2256)  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2350)  at android.app.ActivityThread.access$800(ActivityThread.java:163)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1257)  at android.os.Handler.dispatchMessage(Handler.java:102)  at android.os.Looper.loop(Looper.java:157)  at android.app.ActivityThread.main(ActivityThread.java:5335)  at java.lang.reflect.Method.invokeNative(Native Method)  at java.lang.reflect.Method.invoke(Method.java:515)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1265)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1081)  at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:132)  at dalvik.system.NativeStart.main(Native Method)

    my xml file:

    `

    <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/white" tools:context=".booking.test">

    <de.ehsun.coloredtimebar.TimelineView
        android:id="@+id/timelineView"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:barColorAvailable="@color/available_time_default_color"
        app:barColorHighlight="@color/selector_default_color"
        app:barColorNotAvailable="@color/timeline_default_color"
        app:barWidth="16dp"
        app:fractionLineColor="@color/separatorDark"
        app:fractionLineLength="8dp"
        app:fractionLineWidth="1dp"
        app:fractionPrimaryTextColor="@color/fraction_default_color"
        app:fractionSecondaryTextColor="@color/fraction_default_color"
        app:fractionTextInterval="2"
        app:fractionTextSize="8sp"
        app:timeRange="07:00-19:00" />
    

    </android.support.constraint.ConstraintLayout> `

    opened by ashfaaaa 0
Owner
Ehsan Mehranvari
Full software development lifecycle from very beginning until delivery
Ehsan Mehranvari
Handy states for dynamically obtained data.

Resource Handy states for dynamically obtained data. Table of contents Problem to solve Reasons to use Artifacts resource-plain resource-context Insta

Misha Malasai 6 Dec 12, 2022
A libre smart powered comic book reader for Android.

Seeneva A libre smart powered comic book reader for Android. Translation: Русский • • Features • Speech balloons zooming • OCR and TTS • Performance •

Seeneva comic book reader 130 Jan 7, 2023
A lightweight, simple, smart and powerful Android routing library.

RxRouter Read this in other languages: 中文, English A lightweight, simple, smart and powerful Android routing library. Getting started Setting up the d

Season 323 Nov 10, 2022
How to structure a growing Gradle project with smart dependency management?

How to set up a larger Gradle project This repo shows one possibility to structure a Gradle project when you want: Centralized and maintainable build

Jendrik Johannes 59 Jan 6, 2023
DI can be simple. Forget about modules and components. Just use it!

PopKorn - Kotlin Multiplatform DI PopKorn is a simple, powerful and lightweight Kotlin Multiplatform Dependency Injector. It doesn't need any modules

Pau Corbella 145 Dec 25, 2022
A beautiful material calendar with endless scroll, range selection and a lot more!

CrunchyCalendar A light, powerful and easy to use Calendar Widget with a number out of the box features: Infinite vertical scrolling in both direction

CleverPumpkin 483 Dec 25, 2022
ZoomHelper will make any view to be zoomable just like Instagram pinch-to-zoom

ZoomHelper ZoomHelper will make any view to be zoomable just like the Instagram pinch-to-zoom. ?? Installation ZoomHelper is available in the JCenter,

AmirHosseinAghajari 238 Dec 25, 2022
Just an app with lame dad jokes content to fill up your day.

Just an app with lame dad jokes content to fill up your day. MVP This MVP version features: Feed walks you through the latest dad jokes, Browse back s

null 240 Dec 20, 2022
Minecraft Server Software specially designed for Thicc SMP. Here on GitHub without the private patches, just a normal hybrid JettPack-Pufferfish-Empirecraft fork

AlynaaMC A private, custom server software for Thicc SMP and a fork of Pufferfish. Here on GitHub with patches from JettPack, Airplane and Pufferfish

ThiccMC 14 Dec 31, 2021