Split up into modules and add float module
Split the app/ module into three modules terminal/ - Terminal emulator library module. view/ - Terminal view library module (depending on terminal/). app/ - The main Termux app (depending on view/). Also add the float/ - The Termux:Float app (depending on view/).
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Background for the window, used to draw a border -->
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle" >
|
||||
<stroke
|
||||
android:width="1px"
|
||||
android:color="@android:color/white" />
|
||||
<solid android:color="#FF000000" />
|
||||
</shape>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle" >
|
||||
<stroke
|
||||
android:width="1px"
|
||||
android:color="@android:color/holo_red_light" />
|
||||
<solid android:color="#FF000000" />
|
||||
</shape>
|
||||
18
float/src/main/res/layout/activity_main.xml
Normal file
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.termux.window.TermuxFloatView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/window_layout"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:background="@drawable/floating_window_background"
|
||||
android:padding="1px" >
|
||||
|
||||
<com.termux.view.TerminalView
|
||||
android:id="@+id/terminal_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:focusable="true"
|
||||
android:focusableInTouchMode="true"
|
||||
android:scrollbars="vertical" />
|
||||
|
||||
</com.termux.window.TermuxFloatView>
|
||||
27
float/src/main/res/layout/activity_permission.xml
Normal file
@@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:gravity="center"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<TextView
|
||||
android:layout_gravity="center"
|
||||
android:text="@string/draw_overlay_permission_explanation"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:gravity="center_horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<Button
|
||||
android:layout_marginTop="24dp"
|
||||
android:text="@string/grant_permission"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:onClick="onOkButton"/>
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
BIN
float/src/main/res/mipmap-hdpi/ic_launcher.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
float/src/main/res/mipmap-hdpi/ic_launcher_round.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
float/src/main/res/mipmap-hdpi/ic_service_notification.png
Normal file
|
After Width: | Height: | Size: 695 B |
BIN
float/src/main/res/mipmap-mdpi/ic_launcher.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
float/src/main/res/mipmap-mdpi/ic_launcher_round.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
float/src/main/res/mipmap-xhdpi/ic_launcher.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
float/src/main/res/mipmap-xhdpi/ic_launcher_round.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
float/src/main/res/mipmap-xhdpi/ic_service_notification.png
Normal file
|
After Width: | Height: | Size: 779 B |
BIN
float/src/main/res/mipmap-xxhdpi/ic_launcher.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
BIN
float/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
Normal file
|
After Width: | Height: | Size: 3.7 KiB |
BIN
float/src/main/res/mipmap-xxhdpi/ic_service_notification.png
Normal file
|
After Width: | Height: | Size: 983 B |
BIN
float/src/main/res/mipmap-xxxhdpi/ic_launcher.png
Normal file
|
After Width: | Height: | Size: 2.5 KiB |
BIN
float/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
Normal file
|
After Width: | Height: | Size: 4.9 KiB |
BIN
float/src/main/res/mipmap-xxxhdpi/ic_service_notification.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
19
float/src/main/res/values/strings.xml
Normal file
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<string name="app_name">Termux:Float</string>
|
||||
<string name="initial_instruction_toast">Long press on window to move or resize\n\nDouble tap and drag finger up or down to change font size</string>
|
||||
<string name="after_long_press">Drag to position and pinch to resize</string>
|
||||
|
||||
<string name="draw_overlay_permission_explanation">This app requires permission to draw overlays.</string>
|
||||
<string name="grant_permission">Grant permission</string>
|
||||
|
||||
<string name="notification_title">Termux:Float</string>
|
||||
<string name="notification_message_visible">Touch to hide window.</string>
|
||||
<string name="notification_message_hidden">Touch to show window.</string>
|
||||
|
||||
<string name="paste_text">Paste</string>
|
||||
<string name="copy_text">Copy</string>
|
||||
<string name="text_selection_more">More…</string>
|
||||
|
||||
</resources>
|
||||
20
float/src/main/res/values/styles.xml
Normal file
@@ -0,0 +1,20 @@
|
||||
<resources>
|
||||
|
||||
<!--
|
||||
Base application theme, dependent on API level. This theme is replaced
|
||||
by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
|
||||
-->
|
||||
<style name="AppBaseTheme" parent="android:Theme.Light">
|
||||
<!--
|
||||
Theme customizations available in newer API levels can go in
|
||||
res/values-vXX/styles.xml, while customizations related to
|
||||
backward-compatibility can go here.
|
||||
-->
|
||||
</style>
|
||||
|
||||
<!-- Application theme. -->
|
||||
<style name="AppTheme" parent="AppBaseTheme">
|
||||
<!-- All customizations that are NOT specific to a particular API-level can go here. -->
|
||||
</style>
|
||||
|
||||
</resources>
|
||||