add: manager tab

This commit is contained in:
hyb1996
2017-08-23 12:17:05 +08:00
parent 42f6802598
commit 16d48bd6b5
22 changed files with 464 additions and 249 deletions

View File

@@ -20,9 +20,8 @@
</android.support.design.widget.AppBarLayout>
<view
<com.stardust.scriptdroid.ui.console.LogView
android:id="@+id/console"
class="com.stardust.scriptdroid.ui.console.LogActivity$ConsoleView"
android:layout_width="match_parent"
android:layout_height="match_parent"/>

View File

@@ -12,10 +12,11 @@
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.stardust.widget.AppWithStatusBarLayout
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#5cab7d"
android:paddingTop="16dp"
android:theme="@style/AppTheme.AppBarOverlay">
<android.support.v7.widget.Toolbar
@@ -33,8 +34,7 @@
app:tabGravity="fill"
app:tabIndicatorColor="@android:color/white"
app:tabMode="scrollable"/>
</com.stardust.widget.AppWithStatusBarLayout>
</android.support.design.widget.AppBarLayout>
<android.support.v4.view.ViewPager
android:id="@+id/viewpager"
@@ -43,6 +43,7 @@
app:layout_behavior="@string/appbar_scrolling_view_behavior"/>
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="16dp"
@@ -58,7 +59,6 @@
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="160dp"

View File

@@ -10,7 +10,7 @@
~ copies of the Software, and to permit persons to whom the Software is
~ furnished to do so, subject to the following conditions:
~
~ The above copyright notice and this permission notice shall be included in all
~ The above copyright toast and this permission toast shall be included in all
~ copies or substantial portions of the Software.
~
~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR

View File

@@ -10,7 +10,7 @@
~ copies of the Software, and to permit persons to whom the Software is
~ furnished to do so, subject to the following conditions:
~
~ The above copyright notice and this permission notice shall be included in all
~ The above copyright toast and this permission toast shall be included in all
~ copies or substantial portions of the Software.
~
~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR

View File

@@ -1,63 +1,88 @@
<?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 xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/white"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
android:id="@+id/spinner"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="?selectableItemBackground"
android:clickable="true"
android:padding="8dp">
<LinearLayout
android:id="@+id/close_all"
android:layout_width="match_parent"
<TextView
android:id="@+id/spinner_current_item"
android:layout_width="70dp"
android:layout_height="wrap_content"
android:background="#d4d4d4"
android:foreground="?selectableItemBackground"
android:visibility="gone">
android:layout_gravity="center_vertical"
android:layout_marginLeft="8dp"
android:text="@string/text_task_manage"
android:textColor="#484C4F"
android:textSize="16sp"/>
<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_gravity="center_vertical"
android:text="@string/text_close_all_running_scripts"
android:textColor="@android:color/primary_text_light"
android:textSize="16sp"/>
</LinearLayout>
<android.support.v4.widget.SwipeRefreshLayout
android:id="@+id/swipe_refresh_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.stardust.scriptdroid.ui.main.task.TaskListRecyclerView
android:id="@+id/task_list"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</android.support.v4.widget.SwipeRefreshLayout>
<ImageView
android:layout_width="16dp"
android:layout_height="16dp"
android:layout_gravity="center_vertical"
android:layout_marginLeft="8dp"
android:src="@drawable/ic_arrow_drop_down_black"
android:tint="#484C4F"/>
</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>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/white">
<FrameLayout
android:id="@+id/task_manager_view"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v4.widget.SwipeRefreshLayout
android:id="@+id/swipe_refresh_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.stardust.scriptdroid.ui.main.task.TaskListRecyclerView
android:id="@+id/task_list"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</android.support.v4.widget.SwipeRefreshLayout>
<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>
<android.support.v4.widget.NestedScrollView
android:id="@+id/log"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/white"
android:paddingLeft="6dp"
android:visibility="gone">
<com.stardust.scriptdroid.ui.console.LogView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:color/white"/>
</android.support.v4.widget.NestedScrollView>
</FrameLayout>
</LinearLayout>

View File

@@ -1,30 +1,34 @@
<?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"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/item"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:color/white"
android:clickable="true"
android:foreground="?selectableItemBackground"
android:orientation="horizontal"
android:padding="8dp">
<TextView
android:id="@+id/first_char"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_marginBottom="6dp"
android:layout_gravity="center_vertical"
android:layout_marginLeft="8dp"
android:layout_marginTop="6dp"
android:contentDescription="@string/_app_name"
android:scaleType="fitCenter"
android:src="@drawable/ic_node_js_black"/>
android:background="@drawable/circle_green"
android:gravity="center"
android:textColor="@android:color/white"
android:textSize="24sp"
tools:text="J"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="8dp"
android:layout_marginRight="80dp"
android:layout_toRightOf="@id/icon"
android:layout_gravity="center_vertical"
android:layout_marginLeft="16dp"
android:layout_weight="1"
android:orientation="vertical">
<TextView
@@ -32,41 +36,38 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="end"
android:gravity="center_vertical"
android:maxLines="1"
android:textColor="@android:color/secondary_text_light"
android:textSize="16sp"
android:textColor="#484C4F"
android:textSize="14sp"
tools:text="正在运行的服务"/>
<TextView
android:id="@+id/detail"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:id="@+id/desc"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_marginTop="4dp"
android:ellipsize="end"
android:gravity="center_vertical"
android:maxLines="1"
android:textColor="#777777"
android:textSize="12sp"
tools:text="/storage/emulated/0/脚本/正在运行的服务.txt"/>
android:textColor="#9DA0A2"
android:textSize="11sp"
tools:text="18 KB"/>
</LinearLayout>
<FrameLayout
<ImageView
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">
android:layout_width="36dp"
android:layout_height="match_parent"
android:background="?selectableItemBackgroundBorderless"
android:clickable="true"
android:padding="6dp"
android:src="@drawable/ic_close_gray600_48dp"
android:tint="#A9AAAB"/>
<ImageView
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_gravity="center"
android:contentDescription="@string/_app_name"
android:src="@drawable/ic_close"/>
</LinearLayout>
</FrameLayout>
</RelativeLayout>

View File

@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/task_manage"
android:orderInCategory="100"
android:title="@string/text_task_manage"/>
<item
android:id="@+id/log"
android:orderInCategory="200"
android:title="@string/text_log"/>
</menu>

View File

@@ -1,122 +1,122 @@
<?xml version="1.0" encoding="utf-8"?>
<notices>
<notice>
<toast>
<name>Rhino: JavaScript in Java</name>
<url>https://github.com/mozilla/rhino</url>
<copyright/>
<license>Mozilla Public License 2.0</license>
</notice>
<notice>
</toast>
<toast>
<name>920 Text Editor</name>
<url>https://github.com/jecelyin/920-text-editor-v2</url>
<copyright/>
<license>Apache Software License 2.0</license>
</notice>
<notice>
</toast>
<toast>
<name>LeakCanary</name>
<copyright>Copyright 2015 Square, Inc.</copyright>
<url>https://github.com/square/leakcanary</url>
<license>Apache Software License 2.0</license>
</notice>
<notice>
</toast>
<toast>
<name>StorIO</name>
<url>https://github.com/pushtorefresh/storio</url>
<license>Apache Software License 2.0</license>
</notice>
<notice>
</toast>
<toast>
<name>Material Dialogs</name>
<url>https://github.com/afollestad/material-dialogs</url>
<copyright>Copyright (c) 2014-2016 Aidan Michael Follestad</copyright>
<license>MIT License</license>
</notice>
<notice>
</toast>
<toast>
<name>Gson</name>
<url>https://github.com/google/gson</url>
<copyright>Copyright 2008 Google Inc.</copyright>
<license>Apache Software License 2.0</license>
</notice>
<notice>
</toast>
<toast>
<name>commonmark-java</name>
<url>https://github.com/atlassian/commonmark-java</url>
<copyright>Copyright (c) 2015-2016 Atlassian and others.</copyright>
<license>BSD 2-Clause License</license>
</notice>
<notice>
</toast>
<toast>
<name>Alipay ZeroSdk</name>
<copyright>Copyright 2016 Fung Go (fython)</copyright>
<url>https://github.com/fython/AlipayZeroSdk</url>
<license>Apache Software License 2.0</license>
</notice>
<notice>
</toast>
<toast>
<name>Console</name>
<copyright>Copyright 2015 Josef Raska</copyright>
<url>https://github.com/jraska/Console</url>
<license>Apache Software License 2.0</license>
</notice>
<notice>
</toast>
<toast>
<name>android-issue-reporter</name>
<copyright/>
<url>https://github.com/HeinrichReimer/android-issue-reporter</url>
<license>Apache Software License 2.0</license>
</notice>
<notice>
</toast>
<toast>
<name>SortableTableView</name>
<copyright>Copyright 2015 Ingo Schwarz</copyright>
<url>https://github.com/ISchwarz23/SortableTableView</url>
<license>Apache Software License 2.0</license>
</notice>
<notice>
</toast>
<toast>
<name>MultiLevelListView</name>
<copyright>2016 (C) Copyright Open-RnD Sp. z o.o.</copyright>
<url>https://github.com/open-rnd/android-multi-level-listview</url>
<license>Apache Software License 2.0</license>
</notice>
<notice>
</toast>
<toast>
<name>hover</name>
<copyright>2016 (C) Copyright Open-RnD Sp. z o.o.</copyright>
<url>https://github.com/google/hover</url>
<license>Apache Software License 2.0</license>
</notice>
<notice>
</toast>
<toast>
<name>event-bus</name>
<copyright>2016 (C) Copyright Open-RnD Sp. z o.o.</copyright>
<url>https://github.com/greenrobot/EventBus</url>
<license>Apache Software License 2.0</license>
</notice>
<notice>
</toast>
<toast>
<name>Expandable RecyclerView</name>
<copyright>Copyright (c) 2015 Big Nerd Ranch</copyright>
<url>https://github.com/bignerdranch/expandable-recycler-view</url>
<license>MIT License</license>
</notice>
<notice>
</toast>
<toast>
<name>Android Terminal Emulator</name>
<copyright/>
<url>https://github.com/jackpal/Android-Terminal-Emulator</url>
<license>Apache Software License 2.0</license>
</notice>
<notice>
</toast>
<toast>
<name>RecyclerView-FlexibleDivider</name>
<copyright>Copyright 2016 yqritc</copyright>
<url>https://github.com/yqritc/RecyclerView-FlexibleDivider</url>
<license>Apache Software License 2.0</license>
</notice>
<notice>
</toast>
<toast>
<name>Volley</name>
<copyright/>
<url>https://github.com/google/volley</url>
<license>Apache Software License 2.0</license>
</notice>
<notice>
</toast>
<toast>
<name>Settings Compat</name>
<copyright>Copyright 2016 czy1121</copyright>
<url>https://github.com/czy1121/settingscompat</url>
<license>Apache Software License 2.0</license>
</notice>
<notice>
</toast>
<toast>
<name>Zip4j</name>
<copyright/>
<url>http://www.lingala.net/zip4j/</url>
<license>Apache Software License 2.0</license>
</notice>
</toast>
</notices>

View File

@@ -13,12 +13,12 @@ means the combination of the Contributions of others (if any) used by a Contribu
means Covered Software of a particular Contributor.
1.4. “Covered Software”
means Source Code Form to which the initial Contributor has attached the notice in Exhibit A, the Executable Form of such Source Code Form, and Modifications of such Source Code Form, in each case including portions thereof.
means Source Code Form to which the initial Contributor has attached the toast in Exhibit A, the Executable Form of such Source Code Form, and Modifications of such Source Code Form, in each case including portions thereof.
1.5. “Incompatible With Secondary Licenses”
means
that the initial Contributor has attached the notice described in Exhibit B to the Covered Software; or
that the initial Contributor has attached the toast described in Exhibit B to the Covered Software; or
that the Covered Software was made available under the terms of version 1.1 or earlier of the License, but not also under the terms of a Secondary License.
@@ -77,7 +77,7 @@ for infringements caused by: (i) Your and any other third partys modification
under Patent Claims infringed by Covered Software in the absence of its Contributions.
This License does not grant any rights in the trademarks, service marks, or logos of any Contributor (except as may be necessary to comply with the notice requirements in Section 3.4).
This License does not grant any rights in the trademarks, service marks, or logos of any Contributor (except as may be necessary to comply with the toast requirements in Section 3.4).
2.4. Subsequent Licenses
@@ -127,7 +127,7 @@ If it is impossible for You to comply with any of the terms of this License with
5. Termination
5.1. The rights granted under this License will terminate automatically if You fail to comply with any of its terms. However, if You become compliant, then the rights granted under this License from a particular Contributor are reinstated (a) provisionally, unless and until such Contributor explicitly and finally terminates Your grants, and (b) on an ongoing basis, if such Contributor fails to notify You of the non-compliance by some reasonable means prior to 60 days after You have come back into compliance. Moreover, Your grants from a particular Contributor are reinstated on an ongoing basis if such Contributor notifies You of the non-compliance by some reasonable means, this is the first time You have received notice of non-compliance with this License from such Contributor, and You become compliant prior to 30 days after Your receipt of the notice.
5.1. The rights granted under this License will terminate automatically if You fail to comply with any of its terms. However, if You become compliant, then the rights granted under this License from a particular Contributor are reinstated (a) provisionally, unless and until such Contributor explicitly and finally terminates Your grants, and (b) on an ongoing basis, if such Contributor fails to notify You of the non-compliance by some reasonable means prior to 60 days after You have come back into compliance. Moreover, Your grants from a particular Contributor are reinstated on an ongoing basis if such Contributor notifies You of the non-compliance by some reasonable means, this is the first time You have received toast of non-compliance with this License from such Contributor, and You become compliant prior to 30 days after Your receipt of the toast.
5.2. If You initiate litigation against any entity by asserting a patent infringement claim (excluding declaratory judgment actions, counter-claims, and cross-claims) alleging that a Contributor Version directly or indirectly infringes any patent, then the rights granted to You by any and all Contributors for the Covered Software under Section 2.1 of this License shall terminate.
@@ -165,13 +165,13 @@ If you create software not governed by this License, and you want to create a ne
10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses
If You choose to distribute Source Code Form that is Incompatible With Secondary Licenses under the terms of this version of the License, the notice described in Exhibit B of this License must be attached.
If You choose to distribute Source Code Form that is Incompatible With Secondary Licenses under the terms of this version of the License, the toast described in Exhibit B of this License must be attached.
Exhibit A - Source Code Form License Notice
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
If it is not possible or desirable to put the notice in a particular file, then You may include the notice in a location (such as a LICENSE file in a relevant directory) where a recipient would be likely to look for such a notice.
If it is not possible or desirable to put the toast in a particular file, then You may include the toast in a location (such as a LICENSE file in a relevant directory) where a recipient would be likely to look for such a toast.
You may add additional accurate notices of copyright ownership.

View File

@@ -5,4 +5,6 @@
<color name="colorAccent">#536DFE</color>
<color name="sliding_up_panel_shadow_color">#99444444</color>
<color name="bubble_bg">#eef2f3f9</color>
<color name="color_r">#FD999A</color>
<color name="color_j">#99CC99</color>
</resources>

View File

@@ -6,7 +6,7 @@
<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_left_margin">0dp</dimen>
<dimen name="script_and_folder_list_divider_right_margin">0dp</dimen>
<dimen name="floating_icon_size">56dp</dimen>
<dimen name="floating_icon_margin">0dp</dimen>