Skip to content

Commit bbf6499

Browse files
committed
Make Console betterer
* Redid layout * Made prettier (changed fonts/colors - possibly not to Avamander's rigorous artisanal standards) * Floating action button w/material icon from Google * Use fab or keyboard as ENTER key * clear input/request focus per command (and on start) * Enter command> prompt tells you when it's ready for input * you now see the command you entered * better scrolling (and auto-scroll to bottom) * wrap text instead of having to manually swipe to see text * much more! TODO: * The console's back button seems to be disabled. Not new, just noticed that. * Bug: Stop HTML tags in commands from being interpreted (not big deal) * Would be nice: Timeouton terminal "lockups" or non-returning commands * Feature: Remember previous commands and use up/down arrows to select
1 parent 6963d5d commit bbf6499

File tree

9 files changed

+192
-131
lines changed

9 files changed

+192
-131
lines changed
188 Bytes
Loading
139 Bytes
Loading
199 Bytes
Loading
255 Bytes
Loading
308 Bytes
Loading
Lines changed: 62 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,83 @@
11
<?xml version="1.0" encoding="utf-8"?>
22

33
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
4-
android:orientation="vertical"
5-
android:layout_width="match_parent"
6-
android:layout_height="match_parent">
4+
xmlns:app="http://schemas.android.com/apk/res-auto"
5+
android:layout_width="match_parent"
6+
android:layout_height="match_parent"
7+
android:orientation="vertical">
8+
9+
<ScrollView
10+
android:id="@+id/outputscroll"
11+
android:layout_width="fill_parent"
12+
android:layout_height="wrap_content"
13+
android:layout_above="@+id/input"
14+
android:layout_alignParentTop="true"
15+
android:background="@color/black"
16+
android:gravity="top"
17+
android:scrollHorizontally="false"
18+
android:scrollbarAlwaysDrawVerticalTrack="true"
19+
android:scrollbarFadeDuration="0">
20+
21+
<TextView
22+
android:id="@+id/output"
23+
android:layout_width="fill_parent"
24+
android:layout_height="wrap_content"
25+
android:padding="4dp"
26+
android:scrollHorizontally="false"
27+
android:scrollbars="vertical"
28+
android:singleLine="false"
29+
android:textAppearance="?android:attr/textAppearanceMedium"
30+
android:textColor="@color/orange"
31+
android:textIsSelectable="true"
32+
android:textSize="14sp"
33+
android:typeface="monospace" />
34+
</ScrollView>
735

836
<EditText
37+
android:id="@+id/input"
938
android:layout_width="wrap_content"
1039
android:layout_height="wrap_content"
11-
android:textAppearance="?android:attr/textAppearanceMedium"
12-
android:id="@+id/input"
40+
android:layout_alignParentBottom="true"
41+
android:layout_alignParentEnd="true"
42+
android:layout_alignParentLeft="true"
43+
android:layout_alignParentRight="true"
44+
android:layout_alignParentStart="true"
45+
android:layout_alignTop="@android:id/button1"
1346
android:layout_gravity="bottom|left"
14-
android:hint="@string/command"
1547
android:capitalize="none"
1648
android:clickable="true"
1749
android:editable="true"
50+
android:elegantTextHeight="true"
1851
android:enabled="true"
52+
android:focusable="true"
53+
android:focusableInTouchMode="true"
54+
android:hint="@string/command"
1955
android:imeActionId="4"
20-
android:longClickable="true"
56+
android:imeOptions="actionDone"
2157
android:imeActionLabel="@string/run"
22-
android:typeface="monospace"
23-
android:inputType="textMultiLine|textNoSuggestions"
24-
android:layout_alignParentTop="true"
25-
android:layout_alignParentLeft="true"
26-
android:layout_alignBottom="@android:id/button1"
27-
android:layout_toLeftOf="@android:id/button1"/>
58+
android:inputType="textNoSuggestions"
59+
android:longClickable="true"
60+
android:textAppearance="?android:attr/textAppearanceMedium"
61+
android:textSize="14sp"
62+
android:typeface="monospace" />
2863

29-
<Button
30-
style="?android:attr/buttonStyleSmall"
64+
<android.support.design.widget.FloatingActionButton
65+
android:id="@+id/myFAB"
3166
android:layout_width="wrap_content"
3267
android:layout_height="wrap_content"
33-
android:text="@string/run"
34-
android:id="@android:id/button1"
35-
android:layout_alignParentTop="true"
68+
android:layout_alignBottom="@+id/outputscroll"
69+
android:layout_alignParentEnd="true"
3670
android:layout_alignParentRight="true"
37-
android:enabled="true"
38-
android:clickable="true"
39-
android:fontFamily="sans-serif-condensed"/>
71+
android:layout_marginBottom="-20dp"
72+
android:layout_marginEnd="16dp"
73+
android:layout_marginRight="16dp"
74+
android:src="@drawable/ic_done_white_24dp"
75+
android:text="@string/run"
76+
app:elevation="4dp"
77+
app:fabSize="mini"
78+
app:layout_anchor="@id/outputscroll"
79+
app:layout_anchorGravity="bottom|right|end"
80+
app:rippleColor="@color/pink" />
4081

4182
<!-- <TextView
4283
android:layout_width="fill_parent"
@@ -48,16 +89,4 @@
4889
android:typeface="monospace"
4990
android:scrollbars="horizontal|vertical"/> -->
5091

51-
<EditText
52-
android:layout_width="fill_parent"
53-
android:layout_height="wrap_content"
54-
android:textAppearance="?android:attr/textAppearanceMedium"
55-
android:id="@+id/output"
56-
android:layout_below="@+id/input"
57-
android:layout_alignParentBottom="true"
58-
android:typeface="monospace"
59-
android:scrollbars="horizontal|vertical"
60-
android:gravity="top|left"
61-
android:scrollHorizontally="true"
62-
android:inputType="textMultiLine|textNoSuggestions"/>
6392
</RelativeLayout>

cSploit/res/values/colors.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,6 @@
1515
<color name="green">#4CAF50</color>
1616
<color name="purple">#3F51B5</color>
1717
<color name="orange">#FFC107</color>
18+
<color name="black">#000000</color>
19+
1820
</resources>

cSploit/res/values/strings.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@
3737
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
3838
See the GNU General Public License for more details.
3939
You should have received a copy of the GNU General Public License along with this program.
40-
If not, see http://www.gnu.org/licenses/.
40+
If not, see http://www.gnu.org/licenses/.\n\nAdditionally, some icons have been distributed under the CC-BY 4.0 license and are copyrighted by Google, Inc.
41+
The full icon set is available at https://www.google.com/design/icons .
4142
</string>
4243
<string name="service">Service</string>
4344
<string name="stopped">Stopped&#8230;</string>
@@ -441,7 +442,7 @@
441442
<string name="sessions_title">Open a shell by clicking on a session, or see more options by long press on it.</string>
442443
<string name="open_shell">Open shell</string>
443444
<string name="clear_event_log">Clear event log</string>
444-
<string name="run">Run</string>
445+
<string name="run">&#9166;</string>
445446
<string name="command">Command</string>
446447
<string name="clear">Clear</string>
447448
<string name="save">Save</string>

0 commit comments

Comments
 (0)