Skip to content

Commit

Permalink
Made this look more like a tiling window manager with transparent ter…
Browse files Browse the repository at this point in the history
…minals and a nice image behind it.
  • Loading branch information
sslater11 committed Apr 30, 2021
1 parent 1f7c2c5 commit 2542900
Show file tree
Hide file tree
Showing 4 changed files with 282 additions and 183 deletions.
63 changes: 61 additions & 2 deletions app/src/main/java/ohi/andre/consolelauncher/UIManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -759,6 +759,8 @@ private void updateText(Label l, CharSequence s) {
}
}

private boolean is_simons_sexy_view_enabled = true;

private SuggestionsManager suggestionsManager;

private TextView terminalView;
Expand Down Expand Up @@ -1339,7 +1341,9 @@ public void onGlobalLayout() {
toolbarView = inputOutputView.findViewById(R.id.tools_view);
hideToolbarNoInput = XMLPrefsManager.getBoolean(Toolbar.hide_toolbar_no_input);

applyBgRect(toolbarView, bgRectColors[TOOLBAR_BGCOLOR_INDEX], bgColors[TOOLBAR_BGCOLOR_INDEX], margins[TOOLBAR_MARGINS_INDEX], strokeWidth, cornerRadius);
if( !is_simons_sexy_view_enabled ) {
applyBgRect(toolbarView, bgRectColors[TOOLBAR_BGCOLOR_INDEX], bgColors[TOOLBAR_BGCOLOR_INDEX], margins[TOOLBAR_MARGINS_INDEX], strokeWidth, cornerRadius);
}
}

mTerminalAdapter = new TerminalManager(terminalView, inputView, prefixView, submitView, backView, nextView, deleteView, pasteView, context, mainPack, executer);
Expand All @@ -1352,7 +1356,10 @@ public void onGlobalLayout() {
v.clearFocus();
}
});
applyBgRect(sv, bgRectColors[SUGGESTIONS_BGCOLOR_INDEX], bgColors[SUGGESTIONS_BGCOLOR_INDEX], margins[SUGGESTIONS_MARGINS_INDEX], strokeWidth, cornerRadius);

if( !is_simons_sexy_view_enabled ) {
applyBgRect(sv, bgRectColors[SUGGESTIONS_BGCOLOR_INDEX], bgColors[SUGGESTIONS_BGCOLOR_INDEX], margins[SUGGESTIONS_MARGINS_INDEX], strokeWidth, cornerRadius);
}

LinearLayout suggestionsView = (LinearLayout) rootView.findViewById(R.id.suggestions_group);

Expand All @@ -1371,6 +1378,58 @@ public void onGlobalLayout() {
int drawTimes = XMLPrefsManager.getInt(Ui.text_redraw_times);
if(drawTimes <= 0) drawTimes = 1;
OutlineTextView.redrawTimes = drawTimes;

if( is_simons_sexy_view_enabled ) {
int floatingWindowcolor = Color.argb(200, 0, 0, 0 );

int outsidePadding = 10;
int insidePadding = 5;

// Set our background picture
rootView.setBackgroundResource(R.drawable.jellyfish);

//--------------------------//
// Prettier Device section. //
//--------------------------//

// Set the margins for the device info section.
LinearLayout.LayoutParams params = (LinearLayout.LayoutParams) lViewsParent.getLayoutParams();
params.setMargins( outsidePadding, outsidePadding, outsidePadding, outsidePadding / 2 );
lViewsParent.setLayoutParams( params );

// Set the device info's background colour to make it look like a floating window.
//lViewsParent.setBackgroundColor(Color.argb(127, 0, 0, 255));
lViewsParent.setBackgroundColor( floatingWindowcolor );

// Make the text a little further from the border.
lViewsParent.setPadding( insidePadding, insidePadding, insidePadding, insidePadding );

//----------------------------//
// Prettier Terminal section. //
//----------------------------//
View terminalGroupView = inputOutputView.findViewById(R.id.terminal_group);

// Set the margin
params = (LinearLayout.LayoutParams) terminalGroupView.getLayoutParams();
params.setMargins( outsidePadding, outsidePadding, outsidePadding, outsidePadding / 2 );
terminalGroupView.setLayoutParams( params );

// Set the terminal's background colour to make it look like a floating window.
terminalGroupView.setBackgroundColor( floatingWindowcolor );

// Make the text a little further from the border.
terminalGroupView.setPadding(outsidePadding,outsidePadding/2, outsidePadding, outsidePadding);

//-------------------//
// Prettier Buttons. //
//-------------------//
// Set the background colour for these too.
View toolsView = inputOutputView.findViewById(R.id.tools_view);
toolsView.setBackgroundColor( floatingWindowcolor );

View suggestionsContainerView = inputOutputView.findViewById(R.id.suggestions_container);
suggestionsContainerView.setBackgroundColor( floatingWindowcolor );
}
}

public static int[] getListOfIntValues(String values, int length, int defaultValue) {
Expand Down
Binary file added app/src/main/res/drawable/jellyfish.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
193 changes: 105 additions & 88 deletions app/src/main/res/layout/about_device_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,94 +4,111 @@
android:layout_height="wrap_content"
android:orientation="vertical">

<ohi.andre.consolelauncher.tuils.OutlineTextView android:id="@+id/tv0"
<LinearLayout
android:id="@+id/tv_linear_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:focusable="true"
android:focusableInTouchMode="true"
android:clickable="true"

android:scrollbarAlwaysDrawVerticalTrack="true"
android:scrollbars="vertical" />

<ohi.andre.consolelauncher.tuils.OutlineTextView android:id="@+id/tv1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:focusable="true"
android:focusableInTouchMode="true"
android:clickable="true"

android:scrollbarAlwaysDrawVerticalTrack="true"
android:scrollbars="vertical" />

<ohi.andre.consolelauncher.tuils.OutlineTextView android:id="@+id/tv2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:focusable="true"
android:focusableInTouchMode="true"
android:clickable="true"

android:scrollbarAlwaysDrawVerticalTrack="true"
android:scrollbars="vertical" />

<ohi.andre.consolelauncher.tuils.OutlineTextView android:id="@+id/tv3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:focusable="true"
android:focusableInTouchMode="true"
android:clickable="true"

android:scrollbarAlwaysDrawVerticalTrack="true"
android:scrollbars="vertical" />

<ohi.andre.consolelauncher.tuils.OutlineTextView android:id="@+id/tv4"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:focusable="true"
android:focusableInTouchMode="true"
android:clickable="true"

android:scrollbarAlwaysDrawVerticalTrack="true"
android:scrollbars="vertical" />

<ohi.andre.consolelauncher.tuils.OutlineTextView android:id="@+id/tv5"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:focusable="true"
android:focusableInTouchMode="true"
android:clickable="true"

android:scrollbarAlwaysDrawVerticalTrack="true"
android:scrollbars="vertical" />

<ohi.andre.consolelauncher.tuils.OutlineTextView android:id="@+id/tv6"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:focusable="true"
android:focusableInTouchMode="true"
android:clickable="true"

android:scrollbarAlwaysDrawVerticalTrack="true"
android:scrollbars="vertical" />

<ohi.andre.consolelauncher.tuils.OutlineTextView android:id="@+id/tv7"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:focusable="true"
android:focusableInTouchMode="true"
android:clickable="true"

android:scrollbarAlwaysDrawVerticalTrack="true"
android:scrollbars="vertical" />

<ohi.andre.consolelauncher.tuils.OutlineTextView android:id="@+id/tv8"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:focusable="true"
android:focusableInTouchMode="true"
android:clickable="true"

android:scrollbarAlwaysDrawVerticalTrack="true"
android:scrollbars="vertical" />
android:layout_height="match_parent"
android:orientation="vertical">

<ohi.andre.consolelauncher.tuils.OutlineTextView
android:id="@+id/tv0"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clickable="true"
android:focusable="true"
android:focusableInTouchMode="true"

android:scrollbarAlwaysDrawVerticalTrack="true"
android:scrollbars="vertical" />

<ohi.andre.consolelauncher.tuils.OutlineTextView
android:id="@+id/tv1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clickable="true"
android:focusable="true"
android:focusableInTouchMode="true"

android:scrollbarAlwaysDrawVerticalTrack="true"
android:scrollbars="vertical" />

<ohi.andre.consolelauncher.tuils.OutlineTextView
android:id="@+id/tv2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clickable="true"
android:focusable="true"
android:focusableInTouchMode="true"

android:scrollbarAlwaysDrawVerticalTrack="true"
android:scrollbars="vertical" />

<ohi.andre.consolelauncher.tuils.OutlineTextView
android:id="@+id/tv3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clickable="true"
android:focusable="true"
android:focusableInTouchMode="true"

android:scrollbarAlwaysDrawVerticalTrack="true"
android:scrollbars="vertical" />

<ohi.andre.consolelauncher.tuils.OutlineTextView
android:id="@+id/tv4"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clickable="true"
android:focusable="true"
android:focusableInTouchMode="true"

android:scrollbarAlwaysDrawVerticalTrack="true"
android:scrollbars="vertical" />

<ohi.andre.consolelauncher.tuils.OutlineTextView
android:id="@+id/tv5"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clickable="true"
android:focusable="true"
android:focusableInTouchMode="true"

android:scrollbarAlwaysDrawVerticalTrack="true"
android:scrollbars="vertical" />

<ohi.andre.consolelauncher.tuils.OutlineTextView
android:id="@+id/tv6"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clickable="true"
android:focusable="true"
android:focusableInTouchMode="true"

android:scrollbarAlwaysDrawVerticalTrack="true"
android:scrollbars="vertical" />

<ohi.andre.consolelauncher.tuils.OutlineTextView
android:id="@+id/tv7"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clickable="true"
android:focusable="true"
android:focusableInTouchMode="true"

android:scrollbarAlwaysDrawVerticalTrack="true"
android:scrollbars="vertical" />

<ohi.andre.consolelauncher.tuils.OutlineTextView
android:id="@+id/tv8"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clickable="true"
android:focusable="true"
android:focusableInTouchMode="true"

android:scrollbarAlwaysDrawVerticalTrack="true"
android:scrollbars="vertical" />

</LinearLayout>

</LinearLayout>
Loading

1 comment on commit 2542900

@sslater11
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made it look much nicer by default.
I've only changed the "input_down_layout" as I've not looked at playing with the config yet.
Have a look at the before and after, I think you'll like :).
t-ui-before
t-ui-after

Please sign in to comment.