Skip to content

A smart seek bar with multiple junction points at random seek position.

Notifications You must be signed in to change notification settings

naseemakhtar994/terminal-seekbar

 
 

Repository files navigation

TerminalSeekBar

A smart seek bar for android with multiple junction points at random seek position.

USAGE

To use TerminalSeekBar in your layout XML, Add the library in your Project build.gradle :

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

Add the dependency in the build.gradle (Module: app) :

dependencies {
	compile 'com.github.alshell7:terminal-seekbar:1.1'
}

XML

    <com.projects.alshell.android.TerminalSeekBar
        android:layout_width="wrap_content"
        android:id="@+id/terminalSeekBar"
        android:layout_height="wrap_content"/>

You can use the following properties to change your TerminalSeekBar

Properties

  • app:bar_color, format="color"
  • app:bar_height, format="dimension"
  • app:thumb_height, format="dimension"
  • app:current_value, format="integer"
  • app:background_color, format="color"
  • app:bar_margin, format="dimension"
  • app:max_value, format="integer"

Java

TerminalSeekBar terminalSeekBar = (TerminalSeekBar) findViewById(R.id.terminalSeekBar);

//Create a list of terminals to be set on the TerminalSeekBar
ArrayList<Terminal> terminals = new ArrayList<>();

terminals.add(new Terminal(10, Color.GREEN, "...this..." , Terminal.DEFAULT_PRIORITY_NORMAL));
terminals.add(new Terminal(100, Color.RED, "...HIGH...", Terminal.DEFAULT_PRIORITY_HIGH));
terminals.add(new Terminal(25, Color.BLUE, "...is...", Terminal.DEFAULT_PRIORITY_NORMAL));
terminals.add(new Terminal(70, Color.YELLOW, "...gettING...", Terminal.DEFAULT_PRIORITY_MEDIATE));
terminals.add(new Terminal(50, Color.GRAY, "...check...", Terminal.DEFAULT_PRIORITY_HIGH));

//Attach the terminals to the seek bar
terminalSeekBar.setTerminals(terminals);

//Change the animation of the terminals
terminalSeekBar.enablePriorityBlinking(TerminalAnimationType.BLINK_ACTIVE);

//Set event listeners of the TerminalSeekBar, or by implementing the methods in your Activity
//terminalSeekBar.setTerminalChangedListener(this);
terminalSeekBar.setTerminalChangedListener(new TerminalChangedListener()
{
	@Override
	public void onTerminalChanged(Terminal terminal)
	{
        	//Log.v(TAG, "Current Terminal : " + terminal.getInformation());
	}
});

terminalSeekBar.setSeekBarValueChangedListener(this); //Optional

Animations

The animations for Terminal are encapsulated in TerminalAnimationType.

public enum TerminalAnimationType
{
    BLINK_STILL,
    BLINK_ACTIVE
}

License

Copyright 2017 alshell7

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.

About

A smart seek bar with multiple junction points at random seek position.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 100.0%