Add: floating window, layout inspector

This commit is contained in:
hyb1996
2017-03-12 23:10:58 +08:00
parent a211d208d0
commit e81b661974
164 changed files with 7045 additions and 1206 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:innerRadius="0dp"
android:shape="ring"
android:thicknessRatio="2"
android:useLevel="false">
<solid android:color="@android:color/white"/>
</shape>

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:innerRadius="0dp"
android:shape="ring"
android:thicknessRatio="2"
android:useLevel="false">
<solid android:color="@android:color/white"/>
<stroke
android:width="1dp"
android:color="@android:color/black"/>
</shape>

Binary file not shown.

After

Width:  |  Height:  |  Size: 666 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

View File

@@ -16,7 +16,7 @@
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay">
app:theme="@style/AppTheme.AppBarOverlay">
<com.stardust.theme.widget.ThemeColorToolbar
android:id="@+id/toolbar"

View File

@@ -6,7 +6,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".ui.edit.EditActivity">
tools:context="com.stardust.scriptdroid.ui.edit.EditActivity">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"

View File

@@ -5,7 +5,7 @@
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ui.main.MainActivity">
tools:context="com.stardust.scriptdroid.ui.main.MainActivity">
<android.support.design.widget.CoordinatorLayout

View File

@@ -7,7 +7,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context=".ui.main.MainActivity"
tools:context="com.stardust.scriptdroid.ui.main.MainActivity"
tools:showIn="@layout/activity_main">

View File

@@ -0,0 +1,77 @@
<?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="12dp"
android:paddingLeft="16dp"
android:paddingTop="12dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginRight="80dp"
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_dark"
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:textColor="#e4e4e4"
android:textSize="14sp"
tools:text="/storage/emulated/0/脚本/正在运行的服务.txt"/>
</LinearLayout>
<FrameLayout
android:id="@+id/edit"
android:layout_width="42dp"
android:layout_height="42dp"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="42dp"
android:background="?attr/selectableItemBackgroundBorderless">
<ImageView
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_gravity="center"
android:contentDescription="@string/_app_name"
android:src="@drawable/ic_edit_white"/>
</FrameLayout>
<FrameLayout
android:id="@+id/more"
android:layout_width="42dp"
android:layout_height="42dp"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:background="?attr/selectableItemBackgroundBorderless">
<ImageView
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_gravity="center"
android:contentDescription="@string/_app_name"
android:src="@drawable/more_three_dots_ios_7_white"/>
</FrameLayout>
</RelativeLayout>

View File

@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="40dp"
android:layout_height="40dp"
android:background="@android:color/transparent"
android:orientation="vertical">
<ImageView
android:layout_width="40dp"
android:layout_height="40dp"
android:background="@drawable/circle"
android:padding="5dp"
android:src="@drawable/ic_android_eat_js"/>
</LinearLayout>

View File

@@ -0,0 +1,35 @@
<?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">
<com.stardust.theme.widget.ThemeColorToolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="40dp"
android:background="@color/colorPrimary"
app:popupTheme="@style/AppTheme.PopupOverlay"
app:title="@string/_app_name"
app:titleTextColor="@android:color/white"/>
<ViewSwitcher
android:id="@+id/view_switcher"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.stardust.scriptdroid.layout_inspector.view.NodeInfoView
android:id="@+id/node_info"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#ffffff"/>
<com.stardust.scriptdroid.layout_inspector.view.LayoutHierarchyView
android:id="@+id/bounds_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#ffffff"/>
</ViewSwitcher>
</LinearLayout>

View File

@@ -0,0 +1,37 @@
<?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"
android:theme="@style/AppTheme">
<TextView
android:id="@+id/layout_hierarchy"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?selectableItemBackground"
android:padding="16dp"
android:text="@string/text_layout_hierarchy"
android:textColor="@android:color/primary_text_dark"
android:textSize="16sp"/>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#c4c4c4"/>
<TextView
android:id="@+id/layout_bounds"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?selectableItemBackground"
android:padding="16dp"
android:text="@string/text_layout_bounds"
android:textColor="@android:color/primary_text_dark"
android:textSize="16sp"/>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#c4c4c4"/>
</LinearLayout>

View File

@@ -51,7 +51,7 @@
<RelativeLayout
android:id="@+id/assist_service"
android:id="@+id/floating_window"
android:layout_width="match_parent"
android:layout_height="52dp"
android:background="?selectableItemBackground"
@@ -70,44 +70,11 @@
android:layout_height="match_parent"
android:layout_toRightOf="@id/icon_assist_service"
android:gravity="center"
android:text="@string/text_assist_service"
android:text="@string/text_floating_window"
android:textColor="@android:color/primary_text_light"/>
<com.stardust.theme.widget.ThemeColorSwitch
android:id="@+id/sw_assist_service"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:layout_marginRight="16dp"/>
</RelativeLayout>
<RelativeLayout
android:id="@+id/assist_service_notification"
android:layout_width="match_parent"
android:layout_height="52dp"
android:background="?selectableItemBackground"
android:gravity="center_vertical">
<com.stardust.theme.widget.ThemeColorImageView
android:id="@+id/icon_assist_service_notification"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_alignParentLeft="true"
android:layout_margin="16dp"
android:src="@drawable/ic_notifications_green_48dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_toRightOf="@id/icon_assist_service_notification"
android:gravity="center"
android:text="@string/text_assist_service_notification"
android:textColor="@android:color/primary_text_light"/>
<com.stardust.theme.widget.ThemeColorSwitch
android:id="@+id/sw_assist_service_notification"
android:id="@+id/sw_floating_window"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
@@ -121,8 +88,4 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<com.stardust.scriptdroid.ui.edit.sidemenu.AssistClipListRecyclerView
android:id="@+id/assist_clip_list"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</LinearLayout>

View File

@@ -84,7 +84,7 @@
<RelativeLayout
android:id="@+id/assist_service"
android:id="@+id/floating_window"
android:layout_width="match_parent"
android:layout_height="52dp"
android:background="?selectableItemBackground"
@@ -103,44 +103,11 @@
android:layout_height="match_parent"
android:layout_toRightOf="@id/icon_assist_service"
android:gravity="center"
android:text="@string/text_assist_service"
android:text="@string/text_floating_window"
android:textColor="@android:color/primary_text_light"/>
<com.stardust.theme.widget.ThemeColorSwitch
android:id="@+id/sw_assist_service"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:layout_marginRight="16dp"/>
</RelativeLayout>
<RelativeLayout
android:id="@+id/assist_service_notification"
android:layout_width="match_parent"
android:layout_height="52dp"
android:background="?selectableItemBackground"
android:gravity="center_vertical">
<com.stardust.theme.widget.ThemeColorImageView
android:id="@+id/icon_assist_service_notification"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_alignParentLeft="true"
android:layout_margin="16dp"
android:src="@drawable/ic_notifications_green_48dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_toRightOf="@id/icon_assist_service_notification"
android:gravity="center"
android:text="@string/text_assist_service_notification"
android:textColor="@android:color/primary_text_light"/>
<com.stardust.theme.widget.ThemeColorSwitch
android:id="@+id/sw_assist_service_notification"
android:id="@+id/sw_floating_window"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"

View File

@@ -0,0 +1,53 @@
<?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="32dp"
android:padding="5dp">
<com.stardust.scriptdroid.layout_inspector.view.LevelBeamView
android:id="@+id/dataItemLevelBeam"
android:layout_width="wrap_content"
android:layout_height="32dp"/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="3dp"
android:layout_marginRight="3dp"
android:layout_toLeftOf="@+id/dataItemArrow"
android:layout_toRightOf="@+id/dataItemLevelBeam"
android:gravity="left|center_vertical"
android:orientation="vertical">
<TextView
android:id="@+id/dataItemName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:maxLines="1"
android:textColor="@android:color/black"
android:textSize="16sp"
tools:text="TextView"/>
<TextView
android:id="@+id/dataItemInfo"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:maxLines="1"
android:textColor="@android:color/black"
android:textSize="12sp"
android:visibility="gone"/>
</LinearLayout>
<ImageView
android:id="@+id/dataItemArrow"
android:layout_width="10dp"
android:layout_height="10dp"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="10dp"
android:src="@drawable/arrow_down"/>
</RelativeLayout>

View File

@@ -0,0 +1,14 @@
<?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="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/attr"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<View
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</LinearLayout>

View File

@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<com.stardust.widget.ViewSwitcher
android:id="@+id/container"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="12dp"
android:layout_marginRight="12dp"/>
<ImageView
android:id="@+id/resizer"
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:background="@drawable/circle_with_border"
android:scaleType="fitXY"
android:src="@drawable/ic_resizer"/>
</RelativeLayout>

View File

@@ -1,6 +1,6 @@
<menu 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"
tools:context=".ui.main.MainActivity">
tools:context="com.stardust.scriptdroid.ui.main.MainActivity">
</menu>

View File

@@ -1,5 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<notices>
<notice>
<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>
<name>Material Dialogs</name>
<url>https://github.com/afollestad/material-dialogs</url>
@@ -49,9 +55,27 @@
<license>Apache Software License 2.0</license>
</notice>
<notice>
<name>LeakCanary</name>
<copyright>Copyright 2015 Square, Inc.</copyright>
<url>https://github.com/square/leakcanary</url>
<name>Floaties</name>
<copyright/>
<url>https://github.com/ericbhatti/floaties</url>
<license>Apache Software License 2.0</license>
</notice>
<notice>
<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>
<name>Android Terminal Emulator</name>
<copyright/>
<url>https://github.com/jackpal/Android-Terminal-Emulator</url>
<license>Apache Software License 2.0</license>
</notice>
<notice>
<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>
</notices>

View File

@@ -39,7 +39,7 @@ means any of the following:
any file in Source Code Form that results from an addition to, deletion from, or modification of the contents of Covered Software; or
any new file in Source Code Form that contains any Covered Software.
any new file in Source Code Form that regex any Covered Software.
1.11. “Patent Claims” of a Contributor
means any patent claim(s), including without limitation, method, process, and apparatus claims, in any patent Licensable by such Contributor that would be infringed, but for the grant of the License, by the making, using, selling, offering for sale, having made, import, or transfer of either its Contributions or its Contributor Version.
@@ -161,7 +161,7 @@ You may distribute the Covered Software under the terms of the version of the Li
10.3. Modified Versions
If you create software not governed by this License, and you want to create a new license for such software, you may create and use a modified version of this License if you rename the license and remove any references to the name of the license steward (except to note that such modified license differs from this License).
If you create software not governed by this License, and you want to create a new license for such software, you may create and use a modified version of this License if you rename the license and remove any references to the key of the license steward (except to note that such modified license differs from this License).
10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses

View File

@@ -29,7 +29,7 @@
<string name="air_dialog_description_failed_issues_not_available">Issues不可用请联系软件开发者.</string>
<string name="air_dialog_description_failed_unknown">未知错误</string>
<string name="air_dialog_action_failed">OK</string>
<plurals name="air_error_short_description">
<plurals key="air_error_short_description">
<item quantity="one">描述至少要 %d 个字.</item>
<item quantity="other">描述至少要 %d 个字.</item>
</plurals>

View File

@@ -3,4 +3,8 @@
<dimen name="activity_horizontal_margin">16dp</dimen>
<dimen name="activity_vertical_margin">16dp</dimen>
<dimen name="fab_margin">16dp</dimen>
<dimen name="level_beam_view_padding_left">3dp</dimen>
<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>
</resources>

View File

@@ -50,7 +50,7 @@
<string name="text_email">邮箱</string>
<string name="my_github">https://github.com/hyb1996/NoRootScriptDroid</string>
<string name="share_app">[免Root脚本精灵]下载地址http://www.coolapk.com/apk/com.stardust.scriptdroid </string>
<string name="text_assist_service">点击区域辅助服务</string>
<string name="text_floating_window">悬浮窗</string>
<string name="text_assist_service_notification">通知栏点击区域辅助开关</string>
<string name="text_others">其他</string>
<string name="text_assist_mode_enabled">点击区域辅助服务已开启(点击关闭)</string>
@@ -137,4 +137,9 @@
<string name="text_help">帮助</string>
<string name="text_root_script_record">录制脚本(root)</string>
<string name="hint_start_root_record">使用音量上键,音量下键结束录制</string>
<string name="text_no_floating_window_permission">没有悬浮窗权限</string>
<string name="text_node_info">节点信息</string>
<string name="text_layout_hierarchy">布局层次分析</string>
<string name="text_layout_bounds">布局范围查看</string>
<string name="text_no_accessibility_permission_to_capture">无障碍服务未启动</string>
</resources>