Add: Task manager

This commit is contained in:
hyb1996
2017-04-04 00:26:14 +08:00
parent 59811a4a5d
commit b762ceb60b
54 changed files with 758 additions and 329 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

View File

@@ -1,13 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<view
android:id="@+id/console"
class="com.stardust.scriptdroid.ui.console.ConsoleActivity$ConsoleView"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</LinearLayout>

View File

@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">

View File

@@ -0,0 +1,47 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#f4f4f4">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:id="@+id/close_all"
android:layout_width="match_parent"
android:layout_height="42dp"
android:background="#e4e4e4"
android:foreground="?selectableItemBackground"
android:gravity="center_vertical"
android:orientation="horizontal"
android:visibility="gone">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:text="@string/text_close_all_running_scripts"
android:textColor="@android:color/secondary_text_light"
android:textSize="16sp"/>
</LinearLayout>
<com.stardust.scriptdroid.ui.main.task.TaskListRecyclerView
android:id="@+id/task_list"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</LinearLayout>
<TextView
android:id="@+id/notice_no_running_script"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:text="@string/notice_no_running_script"
android:textColor="#adadad"
android:textSize="16sp"/>
</FrameLayout>

View File

@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:foreground="?android:selectableItemBackground">
<ImageView
android:id="@+id/icon"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_marginBottom="4dp"
android:layout_marginLeft="8dp"
android:layout_marginTop="4dp"
android:contentDescription="@string/_app_name"
android:scaleType="fitCenter"
android:src="@drawable/ic_folder_yellow_100px"/>
<TextView
android:id="@+id/name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="8dp"
android:layout_marginRight="80dp"
android:layout_toRightOf="@id/icon"
android:ellipsize="end"
android:maxLines="1"
android:textColor="@android:color/secondary_text_light"
android:textSize="16sp"
tools:text="示例脚本"/>
</RelativeLayout>

View File

@@ -0,0 +1,56 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:foreground="?android:selectableItemBackground">
<ImageView
android:id="@+id/icon"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_marginBottom="4dp"
android:layout_marginLeft="8dp"
android:layout_marginTop="4dp"
android:contentDescription="@string/_app_name"
android:scaleType="fitCenter"
android:src="@drawable/ic_node_js_black"/>
<TextView
android:id="@+id/name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="8dp"
android:layout_marginRight="80dp"
android:layout_toRightOf="@id/icon"
android:ellipsize="end"
android:maxLines="1"
android:textColor="@android:color/secondary_text_light"
android:textSize="16sp"
tools:text="正在运行的服务"/>
<LinearLayout
android:id="@+id/run"
android:layout_width="42dp"
android:layout_height="42dp"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="12dp"
android:background="?attr/selectableItemBackgroundBorderless"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="32dp"
android:layout_height="32dp"
android:layout_gravity="center"
android:contentDescription="@string/_app_name"
android:src="@drawable/ic_play"/>
</LinearLayout>
</RelativeLayout>

View File

@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
android:background="#fefefe">
<com.stardust.scriptdroid.ui.main.script_list.ScriptAndFolderListRecyclerView
android:id="@+id/script_list_recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#fafafa"/>
android:layout_height="match_parent"/>
<FrameLayout
android:id="@+id/progressBar"

View File

@@ -1,53 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:foreground="?android:selectableItemBackground"
android:orientation="vertical"
android:paddingBottom="8dp"
android:paddingLeft="8dp"
android:paddingTop="8dp">
<ImageView
android:id="@+id/icon"
android:layout_width="48dp"
android:layout_height="48dp"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:contentDescription="@string/_app_name"
android:scaleType="fitCenter"
android:src="@drawable/ic_folder_yellow_200px"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginLeft="56dp"
android:gravity="center_vertical"
android:orientation="vertical">
<TextView
android:id="@+id/name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLines="1"
android:textColor="@android:color/primary_text_light"
android:textSize="18sp"
tools:text="示例脚本"/>
<TextView
android:id="@+id/path"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:ellipsize="end"
android:maxLines="1"
android:gravity="center_vertical"
android:textColor="#777777"
android:textSize="14sp"
tools:text="/storage/emulated/0/脚本/示例脚本"/>
</LinearLayout>
</RelativeLayout>

View File

@@ -0,0 +1,72 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:foreground="?android:selectableItemBackground">
<ImageView
android:id="@+id/icon"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_marginBottom="6dp"
android:layout_marginLeft="8dp"
android:layout_marginTop="6dp"
android:contentDescription="@string/_app_name"
android:scaleType="fitCenter"
android:src="@drawable/ic_node_js_black"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="8dp"
android:layout_marginRight="80dp"
android:layout_toRightOf="@id/icon"
android:orientation="vertical">
<TextView
android:id="@+id/name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLines="1"
android:textColor="@android:color/secondary_text_light"
android:textSize="16sp"
tools:text="正在运行的服务"/>
<TextView
android:id="@+id/detail"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:ellipsize="end"
android:maxLines="1"
android:textColor="#777777"
android:textSize="12sp"
tools:text="/storage/emulated/0/脚本/正在运行的服务.txt"/>
</LinearLayout>
<FrameLayout
android:id="@+id/stop"
android:layout_width="42dp"
android:layout_height="42dp"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="12dp"
android:background="?attr/selectableItemBackgroundBorderless"
android:gravity="center">
<ImageView
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_gravity="center"
android:contentDescription="@string/_app_name"
android:src="@drawable/ic_close"/>
</FrameLayout>
</RelativeLayout>

View File

@@ -157,6 +157,7 @@
<string name="text_off">OFF</string>
<string name="text_please_choose_file_to_import">请选择要导入的脚本</string>
<string name="text_refresh">刷新</string>
<string name="notice_no_running_script"><![CDATA[没有正在运行的脚本 φ(>ω<*)]]></string>
<string-array name="record_control_keys">
<item>None</item>
<item>Volume Up</item>

View File

@@ -7,4 +7,6 @@
<dimen name="level_beam_view_line_width">6dp</dimen>
<dimen name="level_beam_view_line_offset">2dp</dimen>
<dimen name="level_beam_view_padding_right">-4dp</dimen>
<dimen name="script_and_folder_list_divider_left_margin">56dp</dimen>
<dimen name="script_and_folder_list_divider_right_margin">0dp</dimen>
</resources>

View File

@@ -187,6 +187,7 @@
<string name="text_no_brower">没有浏览器耶o(╯□╰)o快去安装一个吧</string>
<string name="text_please_choose_file_to_import">请选择要导入的脚本</string>
<string name="text_refresh">刷新</string>
<string name="notice_no_running_script"><![CDATA[没有正在运行的脚本 φ(>ω<*)]]></string>
<string-array name="record_control_keys">
<item></item>