Skip to content

navasmdc/TerminalView

Repository files navigation

TerminalView

Curious view that simulates a terminal

Add Line

Import

Add it in your root build.gradle at the end of repositories:


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

Add the dependency


	dependencies {
	        compile 'com.github.navasmdc:TerminalView:1.0'
	}
	

Use

In order to use this view you have to add this lines to your xml file


<com.gc.terminalview.TerminalView
        android:id="@+id/terminal_view"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:textSize="7dp"/>


With android:textSize you can change the text size of the lines.

Add line

Add a line to the TerminalView

This function play a keyboard sound

Add Line


terminalView.addLine(text);
// or with listener
terminalView.addLine(text,onLineWritedListener);


Add error line

Add an error line to the TerminalView

This function play a keyboard sound

Add Line


terminalView.addError(error);
// or with listener
terminalView.addError(text,onLineWritedListener);


Progress

Display a progress indicator

Add Line


// Display the progress indicator
terminalView.showProgress();
// Hide the progress indicator
terminalView.hideProgress();