Change the way of action pefrom(no longer wait for event), add loading jar file support, fix simple action memory leak

This commit is contained in:
hyb1996
2017-04-05 22:35:31 +08:00
parent b762ceb60b
commit 6844eb9841
88 changed files with 1797 additions and 832 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 509 B

View File

@@ -1,9 +1,54 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:color/transparent"
android:clipToPadding="false"
android:theme="@style/AppTheme.AppBarOverlay">
<com.stardust.theme.widget.ThemeColorToolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:popupTheme="@style/AppTheme.PopupOverlay"
app:title="@string/_app_name">
</com.stardust.theme.widget.ThemeColorToolbar>
</android.support.design.widget.AppBarLayout>
<LinearLayout
android:id="@+id/edit_script"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#e4e4e4"
android:foreground="?selectableItemBackground">
<ImageView
android:layout_width="22dp"
android:layout_height="22dp"
android:layout_marginBottom="12dp"
android:layout_marginLeft="17dp"
android:layout_marginRight="17dp"
android:layout_marginTop="12dp"
android:src="@drawable/ic_edit_gray_48dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="@string/text_edit_prepare_script"
android:textColor="@android:color/primary_text_light"
android:textSize="16sp"/>
</LinearLayout>
<com.stardust.scriptdroid.ui.main.script_list.ScriptListWithProgressBarView
android:id="@+id/script_list"
android:layout_width="match_parent"

View File

@@ -0,0 +1,71 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context="com.stardust.scriptdroid.ui.edit.EditActivity">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.stardust.theme.widget.ThemeColorToolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="@style/AppTheme.PopupOverlay"
app:title="@string/_app_name">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="right"
android:orientation="horizontal"
android:paddingRight="8dp">
<com.stardust.widget.ToolbarMenuItem
android:id="@+id/undo"
android:layout_width="40dp"
android:layout_height="match_parent"
app:icon="@drawable/ic_undo_white_48dp"
app:text="@string/text_undo"/>
<com.stardust.widget.ToolbarMenuItem
android:id="@+id/redo"
android:layout_width="40dp"
android:layout_height="match_parent"
app:icon="@drawable/ic_redo_white_48dp"
app:text="@string/text_redo"/>
</LinearLayout>
</com.stardust.theme.widget.ThemeColorToolbar>
<TextView
android:id="@+id/summary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/toolbar"
android:layout_marginLeft="72dp"
android:textColor="@android:color/white"
android:textSize="10sp"
tools:text="@string/summary_pre_execute_script"/>
</RelativeLayout>
</android.support.design.widget.AppBarLayout>
<include layout="@layout/content_edit"/>
</LinearLayout>

View File

@@ -7,7 +7,8 @@
android:orientation="vertical"
android:paddingBottom="12dp"
android:paddingLeft="16dp"
android:paddingTop="12dp">
android:paddingTop="12dp"
tools:background="@color/colorPrimary">
<LinearLayout
android:layout_width="match_parent"

View File

@@ -4,6 +4,7 @@
android:layout_height="match_parent"
android:background="#f4f4f4">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
@@ -12,19 +13,26 @@
<LinearLayout
android:id="@+id/close_all"
android:layout_width="match_parent"
android:layout_height="42dp"
android:background="#e4e4e4"
android:layout_height="wrap_content"
android:background="#d4d4d4"
android:foreground="?selectableItemBackground"
android:gravity="center_vertical"
android:orientation="horizontal"
android:visibility="gone">
<ImageView
android:layout_width="22dp"
android:layout_height="22dp"
android:layout_marginBottom="12dp"
android:layout_marginLeft="17dp"
android:layout_marginRight="17dp"
android:layout_marginTop="12dp"
android:src="@drawable/ic_close_gray600_48dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_gravity="center_vertical"
android:text="@string/text_close_all_running_scripts"
android:textColor="@android:color/secondary_text_light"
android:textColor="@android:color/primary_text_light"
android:textSize="16sp"/>
</LinearLayout>

View File

@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/action_refresh"
android:icon="@drawable/ic_refresh_white_24dp"
android:orderInCategory="100"
android:title="@string/text_refresh"
app:showAsAction="ifRoom"/>
<item
android:id="@+id/action_clear_file_selection"
android:orderInCategory="200"
android:title="@string/text_clear_file_selection"
app:showAsAction="never"/>
<item
android:id="@+id/action_clear_pre_execute_script"
android:orderInCategory="300"
android:title="@string/text_clear_pre_execute_script"
app:showAsAction="never"/>
</menu>

View File

@@ -188,6 +188,12 @@
<string name="text_please_choose_file_to_import">请选择要导入的脚本</string>
<string name="text_refresh">刷新</string>
<string name="notice_no_running_script"><![CDATA[没有正在运行的脚本 φ(>ω<*)]]></string>
<string name="text_please_choose_a_script">请选择脚本</string>
<string name="text_edit_prepare_script">编辑预执行脚本</string>
<string name="text_pre_execute_script">预执行脚本</string>
<string name="text_clear_pre_execute_script">清空预执行脚本</string>
<string name="text_clear_file_selection">重置脚本文件选择</string>
<string name="summary_pre_execute_script">将在脚本文件执行前执行</string>
<string-array name="record_control_keys">
<item></item>

View File

@@ -48,7 +48,7 @@
<item name="textForeground">#000000</item>
<item name="textBackground">#FFFFFF</item>
<item name="caret">#000000</item>
<item name="selection">#4D97FF54</item>
<item name="selection">@color/colorPrimary</item>
<item name="invisibles">#dddddd</item>
<item name="gutterForeground">#000000</item>
<item name="gutterBackground">#dfdfdf</item>