Added new Look and feel with new icons, and fixed some issue with app authentication

This commit is contained in:
Lewis Hemens 2014-03-22 17:05:35 +00:00
parent eaf92f51b0
commit dee8731e2f
9 changed files with 80 additions and 93 deletions

View File

@ -4,6 +4,7 @@ import android.app.Activity;
import android.os.Bundle; import android.os.Bundle;
import android.view.Menu; import android.view.Menu;
import android.view.MenuItem; import android.view.MenuItem;
import android.webkit.WebChromeClient;
import android.webkit.WebSettings; import android.webkit.WebSettings;
import android.webkit.WebView; import android.webkit.WebView;
import android.webkit.WebViewClient; import android.webkit.WebViewClient;
@ -19,8 +20,18 @@ public class AsciiflowApp extends Activity {
webView = (WebView) findViewById(R.id.activity_main_webview); webView = (WebView) findViewById(R.id.activity_main_webview);
WebSettings webSettings = webView.getSettings(); WebSettings webSettings = webView.getSettings();
webSettings.setJavaScriptEnabled(true); webSettings.setJavaScriptEnabled(true);
webSettings.setSupportMultipleWindows(true);
webSettings.setJavaScriptCanOpenWindowsAutomatically(true);
webView.setWebViewClient(new WebViewClient()); webView.setWebViewClient(new WebViewClient());
webView.loadUrl("http://lewish.github.io/asciiflow2/app"); webView.setWebChromeClient(new WebChromeClient() {
@Override
public void onCloseWindow(WebView window) {
webView.removeView(window);
super.onCloseWindow(window);
}
});
webView.loadUrl("http://lewish.github.io/asciiflow2/");
} }

BIN
images/box-tool.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 950 B

BIN
images/erase-tool.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
images/freeform-tool.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
images/info-button.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
images/line-tool.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 407 B

BIN
images/move-tool.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
images/text-tool.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@ -13,11 +13,47 @@
font-size: 0.95em; font-size: 0.95em;
} }
#draw-tools, #file-tools, #edit-tools, #drive-tools, .tooltip { body {
margin: 0px;
}
#draw-tools {
text-align: center;
display: inline-block; display: inline-block;
position: relative; position: fixed;
float: left; width: 100%;
background-color: #FFF;
z-index: 100; z-index: 100;
box-shadow:0px 3px 3px #CCC;
}
#file-tools {
text-align: right;
display: inline-block;
position: fixed;
width: 100%;
z-index: 100;
}
button {
display: inline-block;
margin: 5px;
width: 30px;
height: 30px;
text-align: center;
cursor: pointer;
outline: 0 !important;
background-size: 100% !important;
}
/* Mobile overrides */
@media(max-width:600px) {
/* Move file tools to the bottom. */
#file-tools {
bottom: 0px;
background-color: #FFF;
box-shadow:0px -3px 3px #CCC;
}
} }
.dialog { .dialog {
@ -29,50 +65,32 @@
margin: auto; margin: auto;
max-width: 640px; max-width: 640px;
max-height: 480px; max-height: 480px;
width: 80%; width: 90%;
height: 80%; height: 70%;
background: #B2CAFF; background: #FFF;
border-width: 2px;
border-color: #777;
border-style: solid;
display: none; display: none;
z-index: 100; z-index: 100;
padding: 5px; padding: 5px;
box-shadow:0px 0px 3px 3px #CCC;
} }
.visible { .visible {
display: block !important; display: block !important;
} }
button { #draw-tools > button, #file-tools > button {
display: block; background: transparent;
margin: 3px; border-width: 0px;
width: 60px;
height: 30px;
text-align: center;
cursor: pointer;
outline: 0 !important;
border-width: 2px;
border-color: #777;
border-style: solid;
}
#draw-tools > button {
background: #B2CAFF;
} }
#draw-tools > button.active { #draw-tools > button.active {
background: #8BB5FF; /* TODO: Offset background images. */
} }
#file-tools > button { #file-tools > button {
background: #D8D8D8; background: #D8D8D8;
} }
#edit-tools > button {
background: #FCB789;
}
.dialog > button { .dialog > button {
margin-top: 6px; margin-top: 6px;
display: inline-block; display: inline-block;
@ -84,23 +102,8 @@ button {
top: 0px; top: 0px;
} }
#logo {
position: fixed;
top: 0px;
left: 0px;
z-index: 100;
background: #F8F8F8;
border-right: 1px solid #444;
border-bottom: 1px solid #444;
}
#drive-textarea { #drive-textarea {
margin: 9px;
}
#logo pre {
margin: 0px;
display: none;
} }
textarea { textarea {
@ -115,68 +118,34 @@ textarea {
white-space: pre; white-space: pre;
} }
.tooltip {
display: none;
}
/* Horrible hack to stop touble tap events on mobile/tablet. */
/* TODO: Enable tooltips on mobile without double tap .*/
media(min-width:800px) {
.tool:hover > .tooltip {
display: block;
position: fixed;
bottom: 5px;
left: 5px;
}
}
</style> </style>
</head> </head>
<body> <body>
<div id="logo"><pre>
__ ____ ____ _ _ ____ _____ _ __
/ \ | ___|| ___||_||_| / ___|| | _ | \ __ / /
/ /\ \|_ \ | | _ _ / / | | | | | |\ \/ \/ /
/ __ \_\ \ | |__ | || |/ __| | |_| |_| | \ /
/__/ \__\___||____||_||_|_/ |____|____| \_/\_/
</pre></div>
<div id="draw-tools"> <div id="draw-tools">
<button id="box-button" class="tool active">Box <button id="box-button" class="tool active" style="background-image: url('images/box-tool.png');">
<div class="tooltip">Draw boxes. You can resize them later with the Resize tool.</div>
</button> </button>
<button id="line-button" class="tool">Line <button id="line-button" class="tool" style="background-image: url('images/line-tool.png');">
<div class="tooltip">Draw lines. Connect it to another line to change the orientation.</div>
</button> </button>
<button id="freeform-button" class="tool">Draw <button id="freeform-button" class="tool" style="background-image: url('images/freeform-tool.png');">
<div class="tooltip">Press a character on the keyboard, then drag to draw it.</div>
</button> </button>
<button id="erase-button" class="tool">Erase <button id="erase-button" class="tool" style="background-image: url('images/erase-tool.png');">
<div class="tooltip">Drag out an area to erase.</div>
</button> </button>
<button id="move-button" class="tool">Resize <button id="move-button" class="tool" style="background-image: url('images/move-tool.png');">
<div class="tooltip">Resize boxes and lines, just drag a line to change it.</div>
</button> </button>
<button id="text-button" class="tool">Text <button id="text-button" class="tool" style="background-image: url('images/text-tool.png');">
<div class="tooltip">Press where to start writing, and type the text you want.</div>
</button> </button>
<!-- <button id="select-button">Select</button> -->
</div> </div>
<div id="file-tools"> <div id="file-tools">
<button id="export-button" class="tool">Export</button>
<button id="import-button" class="tool">Import</button>
<button id="save-button" class="tool">Save</button>
<!-- <button id="save-button" class="tool">Open</button> -->
<button id="options-button" class="tool">Mode</button>
</div>
<div id="edit-tools">
<button id="clear-button" class="tool">Clear</button>
<button id="undo-button" class="tool">Undo</button>
</div>
<div id="drive-tools">
<div id="drive-filename" class="edit"></div> <div id="drive-filename" class="edit"></div>
<button id="export-button" class="tool">Ex</button>
<button id="import-button" class="tool">Im</button>
<button id="save-button" class="tool">Sa</button>
<button id="clear-button" class="tool">Cl</button>
<button id="undo-button" class="tool">Un</button>
<button id="redo-button" class="tool">Re</button>
<button id="options-button" class="tool" style="background-image: url('images/info-button.png');"></button>
</div> </div>
<div id="export-button-dialog" class="dialog"> <div id="export-button-dialog" class="dialog">
@ -185,6 +154,13 @@ media(min-width:800px) {
</div> </div>
<div id="options-button-dialog" class="dialog"> <div id="options-button-dialog" class="dialog">
<div class="tooltip">Draw boxes. You can resize them later with the Resize tool.</div>
<div class="tooltip">Draw lines. Connect it to another line to change the orientation.</div>
<div class="tooltip">Press a character on the keyboard, then drag to draw it.</div>
<div class="tooltip">Drag out an area to erase.</div>
<div class="tooltip">Resize boxes and lines, just drag a line to change it.</div>
<div class="tooltip">Press where to start writing, and type the text you want.</div>
<button id="use-lines-button">Lines Mode</button> <button id="use-lines-button">Lines Mode</button>
<button id="use-ascii-button">ASCII Mode</button> <button id="use-ascii-button">ASCII Mode</button>
</div> </div>