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

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>