Skip to content

Commit

Permalink
Create LiquidView to encapsulate surfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
ericwlange committed Feb 23, 2017
1 parent 2022f75 commit 78edf66
Show file tree
Hide file tree
Showing 30 changed files with 15,292 additions and 14,155 deletions.
2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion ConsoleSurface/build.gradle
Expand Up @@ -7,7 +7,7 @@ android {
buildToolsVersion "25.0.2"

defaultConfig {
minSdkVersion 16
minSdkVersion 17
targetSdkVersion 24
versionCode 2
versionName "0.2.0"
Expand Down
Expand Up @@ -75,6 +75,14 @@ public void removeListener(Listener listener) {

private final ConsoleOutputStream stream;

public void setDisplayText(CharSequence text) {
if (stream != null) {
stream.displayText = text;
setText(text);
stream.index = stream.displayText.length();
}
}

private class ConsoleOutputStream extends HtmlAnsiOutputStream {

ConsoleOutputStream(ByteArrayOutputStream byteArrayOutputStream) {
Expand Down Expand Up @@ -207,7 +215,8 @@ protected void processEraseScreen(int eraseOption) throws IOException {
synchronized (lock) {
switch(eraseOption) {
case ERASE_SCREEN_TO_END:
displayText = displayText.subSequence(0,index);
displayText = displayText.subSequence(0,
Math.min(index,displayText.length()));
break;
case ERASE_SCREEN_TO_BEGINING:
// FIXME
Expand Down

0 comments on commit 78edf66

Please sign in to comment.