Skip to content

Commit e81b661

Browse files
author
hyb1996
committed
Add: floating window, layout inspector
1 parent a211d20 commit e81b661

File tree

164 files changed

+7043
-1204
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

164 files changed

+7043
-1204
lines changed

.idea/gradle.xml

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

+2-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Binary file not shown.

app/build.gradle

+11-9
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ android {
77
applicationId "com.stardust.scriptdroid"
88
minSdkVersion 19
99
targetSdkVersion 23
10-
versionCode 39
11-
versionName "1.17.0308内测"
10+
versionCode 40
11+
versionName "1.17.0312内测"
1212
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
1313
multiDexEnabled true
1414

@@ -46,30 +46,32 @@ repositories {
4646
}
4747

4848
dependencies {
49+
compile 'com.android.support.test.uiautomator:uiautomator-v18:2.1.0'
4950
compile fileTree(include: ['*.jar', '*.so'], dir: 'libs')
5051
testCompile 'junit:junit:4.12'
5152
debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5'
5253
releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5'
5354
testCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5'
54-
5555
compile 'com.android.support:appcompat-v7:25.1.0'
5656
compile 'com.android.support:design:25.1.0'
57-
5857
compile 'com.github.hyb1996:MutableTheme:0.2.2'
5958
compile 'com.afollestad.material-dialogs:core:0.9.2.3'
6059
compile 'com.google.code.gson:gson:2.8.0'
61-
compile('de.psdev.licensesdialog:licensesdialog:1.8.1')
6260
compile 'com.github.atlassian:commonmark-java:commonmark-parent-0.9.0'
6361
compile 'moe.feng:AlipayZeroSdk:1.1'
6462
compile 'com.jraska:console:0.4.3'
6563
compile 'com.jraska:console-timber-tree:0.4.3'
6664
compile 'com.heinrichreimersoftware:android-issue-reporter:eae4c73cbeb91e98da83fe79a3dea088a8b97448'
67-
//compile 'com.github.jackpal.Android-Terminal-Emulator:emulatorview:v1.0.70'
68-
//compile 'com.github.jackpal.Android-Terminal-Emulator:libtermexec:v1.0.70'
65+
compile 'com.bezyapps.floatieslibrary:floaties:1.0.1'
66+
compile 'de.codecrafters.tableview:tableview:2.5.0'
67+
compile group: "pl.openrnd.android", name: "multi-level-listview", version: "1.0.1"
68+
compile 'de.psdev.licensesdialog:licensesdialog:1.8.1'
69+
compile 'io.mattcarroll.hover:hover:0.9.7'
70+
compile 'org.greenrobot:eventbus:3.0.0'
71+
6972
compile(name: 'libtermexec-release', ext: 'aar')
7073
compile(name: 'emulatorview-release', ext: 'aar')
7174
compile(name: 'term-debug', ext: 'aar')
72-
7375
compile 'com.afollestad.material-dialogs:commons:0.9.2.3'
7476
compile 'com.makeramen:roundedimageview:2.2.1'
7577
compile 'com.rengwuxian.materialedittext:library:2.0.3'
@@ -78,7 +80,7 @@ dependencies {
7880
compile(name: '920-styles-release', ext: 'aar')
7981
compile(name: '920-file_explorer-release', ext: 'aar')
8082
compile(name: '920-app-debug', ext: 'aar')
81-
83+
compile project(':automator')
8284
}
8385

8486
configurations {

app/libs/920-app-debug.aar

114 Bytes
Binary file not shown.

app/libs/emulatorview-release.aar

-1.07 KB
Binary file not shown.

app/proguard-rules.pro

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
# Add any project specific keep options here:
1111

1212
# If your project uses WebView with JS, uncomment the following
13-
# and specify the fully qualified class name to the JavaScript interface
13+
# and specify the fully qualified class key to the JavaScript interface
1414
# class:
1515
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
1616
# public *;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package com.stardust;
2+
3+
/**
4+
* Created by Stardust on 2017/3/8.
5+
*/
6+
7+
public class Test {
8+
9+
10+
}

app/src/main/AndroidManifest.xml

+6-13
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,17 @@
66
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
77
<uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT"/>
88
<uses-permission android:name="com.android.launcher.permission.UNINSTALL_SHORTCUT"/>
9+
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
910

1011
<application
1112
xmlns:tools="http://schemas.android.com/tools"
1213
android:name=".App"
13-
android:allowBackup="true"
14+
android:allowBackup="false"
1415
android:icon="@drawable/ic_android_eat_js"
1516
android:label="@string/_app_name"
1617
android:supportsRtl="true"
1718
android:theme="@style/AppTheme"
18-
tools:replace="android:label">
19+
tools:replace="android:label, android:icon, android:allowBackup">
1920
<activity
2021
android:name=".ui.main.MainActivity"
2122
android:label="@string/_app_name"
@@ -53,17 +54,6 @@
5354

5455
</service>
5556

56-
<service
57-
android:name=".external.tile.BoundsAssistEnableTileService"
58-
android:icon="@drawable/ic_robot_head"
59-
android:label="脚本辅助"
60-
android:permission="android.permission.BIND_QUICK_SETTINGS_TILE">
61-
<intent-filter>
62-
<action
63-
android:name="android.service.quicksettings.action.QS_TILE"/>
64-
</intent-filter>
65-
</service>
66-
6757
<provider
6858
android:name="android.support.v4.content.FileProvider"
6959
android:authorities="com.stardust.scriptdroid.fileprovider"
@@ -89,6 +79,9 @@
8979
<service android:name=".external.notification.bounds_assist.BoundsAssistSwitchNotificationHandleService"/>
9080
<service android:name=".external.notification.record.ActionRecordSwitchHandleService"/>
9181
<service android:name=".service.VolumeChangeListenService"/>
82+
<service android:name="com.stardust.view.Floaty$FloatHeadService"/>
83+
<service android:name="com.stardust.view.ResizableFloaty$FloatingWindowService"/>
84+
<service android:name="com.stardust.scriptdroid.external.floating_window.HoverMenuService"/>
9285

9386
<activity
9487
android:name=".external.open.EditIntentActivity"

app/src/main/assets/javasccript_engine_init.js

+29-3
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,7 @@ var longClick = function(a, b, c, d){
5252
}, arguments);
5353
}
5454

55-
var clickId = function(id){
56-
return droid.click(droid.id(id));
57-
}
55+
5856

5957
var scrollUp = function(a, b, c, d){
6058
if(arguments.length == 0)
@@ -222,6 +220,34 @@ var Text = function(text){
222220
return shell("input text " + text, true).code == 1;
223221
}
224222

223+
224+
var __selector__ = droid.selector();
225+
var __obj__ = new java.lang.Object();
226+
227+
for(var x in __selector__){
228+
if(!__obj__[x] && !this[x]){
229+
this[x] = (function(method) {
230+
return function(){
231+
var s = droid.selector();
232+
if(arguments.length == 0){
233+
return s[method]();
234+
}else if(arguments.length == 1){
235+
return s[method](arguments[0]);
236+
}else if(arguments.length == 2){
237+
return s[method](arguments[0], arguments[1]);
238+
}else{
239+
return s[method].call(s, Array.prototype.slice.call(arguments));
240+
}
241+
};
242+
})(x);
243+
}
244+
245+
}
246+
247+
var $ = function(){
248+
return droid.selector();
249+
}
250+
225251
__importClassOld__(com.stardust.scriptdroid.droid.runtime.Shell);
226252

227253
/*

app/src/main/java/com/stardust/app/OnActivityResultDelegate.java

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package com.stardust.app;
22

3-
import android.app.Activity;
43
import android.content.Intent;
54
import android.util.SparseArray;
65

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
package com.stardust.hover;
2+
3+
import android.content.Context;
4+
import android.support.annotation.NonNull;
5+
import android.support.annotation.Nullable;
6+
import android.view.ViewGroup;
7+
import android.view.WindowManager;
8+
9+
import io.mattcarroll.hover.HoverMenu;
10+
import io.mattcarroll.hover.HoverMenuAdapter;
11+
import io.mattcarroll.hover.Navigator;
12+
import io.mattcarroll.hover.defaulthovermenu.view.ViewHoverMenu;
13+
14+
/**
15+
* Created by Stardust on 2017/3/11.
16+
*/
17+
18+
public class HoverMenuBuilder {
19+
20+
public static final int DISPLAY_MODE_WINDOW = 1; // Display directly in a window.
21+
public static final int DISPLAY_MODE_VIEW = 2; // Display within View hierarchy.
22+
23+
private Context mContext;
24+
private int mDisplayMode = DISPLAY_MODE_WINDOW;
25+
private WindowManager mWindowManager;
26+
private Navigator mNavigator;
27+
private HoverMenuAdapter mAdapter;
28+
private String mSavedVisualState = null;
29+
30+
public HoverMenuBuilder(@NonNull Context context) {
31+
mContext = context;
32+
}
33+
34+
public HoverMenuBuilder displayWithinWindow() {
35+
mWindowManager = (WindowManager) mContext.getSystemService(Context.WINDOW_SERVICE);
36+
mDisplayMode = DISPLAY_MODE_WINDOW;
37+
return this;
38+
}
39+
40+
public HoverMenuBuilder displayWithinView(@NonNull ViewGroup container) {
41+
mDisplayMode = DISPLAY_MODE_VIEW;
42+
return this;
43+
}
44+
45+
public HoverMenuBuilder useNavigator(@Nullable Navigator navigator) {
46+
mNavigator = navigator;
47+
return this;
48+
}
49+
50+
public HoverMenuBuilder useAdapter(@Nullable HoverMenuAdapter adapter) {
51+
mAdapter = adapter;
52+
return this;
53+
}
54+
55+
public HoverMenuBuilder restoreVisualState(@NonNull String visualState) {
56+
mSavedVisualState = visualState;
57+
return this;
58+
}
59+
60+
public HoverMenu build() {
61+
if (DISPLAY_MODE_WINDOW == mDisplayMode) {
62+
WindowHoverMenu windowHoverMenu = new WindowHoverMenu(mContext, mWindowManager, mNavigator, mSavedVisualState);
63+
windowHoverMenu.setAdapter(mAdapter);
64+
return windowHoverMenu;
65+
} else {
66+
ViewHoverMenu viewHoverMenu = new ViewHoverMenu(mContext);
67+
viewHoverMenu.setAdapter(mAdapter);
68+
return viewHoverMenu;
69+
}
70+
}
71+
}

0 commit comments

Comments
 (0)