mirror of
https://github.com/TonyJiangWJ/Auto.js.git
synced 2026-06-21 21:01:43 +08:00
add: circular menu alpha and limited in screen
This commit is contained in:
parent
e9346f0794
commit
02ec8f7fb5
@ -100,7 +100,7 @@ dependencies {
|
||||
compile 'com.wang.avi:library:2.1.3'
|
||||
compile 'org.apache.commons:commons-lang3:3.6'
|
||||
compile 'com.thoughtbot:expandablerecyclerview:1.3'
|
||||
compile 'com.github.hyb1996:FloatingCircularActionMenu:0.0.2'
|
||||
compile('com.github.hyb1996:FloatingCircularActionMenu:0.0.4')
|
||||
compile(name: 'apkbuilder-release', ext: 'aar')
|
||||
|
||||
// RxJava
|
||||
|
||||
8
app/src/main/assets/sample/HTTP网络请求/文件下载.js
Normal file
8
app/src/main/assets/sample/HTTP网络请求/文件下载.js
Normal file
@ -0,0 +1,8 @@
|
||||
var url = "http://www.autojs.org/assets/uploads/profile/3-profileavatar.png";
|
||||
var res = http.get(url);
|
||||
if(res.statusCode != 200){
|
||||
toast("请求失败");
|
||||
}
|
||||
files.writeBytes("/sdcard/1.png", res.body.bytes());
|
||||
toast("下载成功");
|
||||
app.viewFile("/sdcard/1.png");
|
||||
@ -64,6 +64,8 @@ public class CircularMenu implements Recorder.OnStateChangedListener {
|
||||
public static final int STATE_NORMAL = 0;
|
||||
public static final int STATE_RECORDING = 1;
|
||||
|
||||
private static final int IC_ACTION_VIEW = R.drawable.ic_circular_menu;
|
||||
|
||||
CircularActionMenuFloatingWindow mWindow;
|
||||
private int mState;
|
||||
private ImageView mActionViewIcon;
|
||||
@ -110,7 +112,7 @@ public class CircularMenu implements Recorder.OnStateChangedListener {
|
||||
return menu;
|
||||
}
|
||||
});
|
||||
mWindow.setKeepToSideHiddenWidthRadio(0.2f);
|
||||
mWindow.setKeepToSideHiddenWidthRadio(0.3f);
|
||||
FloatyService.addWindow(mWindow);
|
||||
}
|
||||
|
||||
@ -142,7 +144,7 @@ public class CircularMenu implements Recorder.OnStateChangedListener {
|
||||
int previousState = mState;
|
||||
mState = state;
|
||||
mActionViewIcon.setImageResource(mState == STATE_RECORDING ? R.drawable.ic_ali_record :
|
||||
R.drawable.autojs_logo);
|
||||
IC_ACTION_VIEW);
|
||||
mActionViewIcon.setBackgroundResource(mState == STATE_RECORDING ? R.drawable.circle_red :
|
||||
0);
|
||||
if (state == STATE_RECORDING) {
|
||||
|
||||
BIN
app/src/main/res/drawable-xhdpi/ic_circular_menu.png
Normal file
BIN
app/src/main/res/drawable-xhdpi/ic_circular_menu.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 116 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 305 KiB |
@ -47,7 +47,7 @@
|
||||
android:layout_width="90dp"
|
||||
android:layout_height="90dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:src="@drawable/autojs_logo"/>
|
||||
android:src="@drawable/autojs_material"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/version"
|
||||
|
||||
@ -1,7 +0,0 @@
|
||||
<?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">
|
||||
|
||||
</LinearLayout>
|
||||
@ -1,28 +0,0 @@
|
||||
<?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:theme="@style/AppTheme.AppBarOverlay">
|
||||
|
||||
<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"/>
|
||||
|
||||
</android.support.design.widget.AppBarLayout>
|
||||
|
||||
<com.stardust.autojs.core.console.ConsoleView
|
||||
android:id="@+id/console"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
</LinearLayout>
|
||||
@ -8,5 +8,5 @@
|
||||
android:id="@+id/icon"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:src="@drawable/autojs_logo"/>
|
||||
android:src="@drawable/ic_circular_menu"/>
|
||||
</LinearLayout>
|
||||
@ -1,11 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item
|
||||
android:id="@+id/action_copy_line"
|
||||
android:title="@string/text_copy_line"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/action_delete_line"
|
||||
android:title="@string/text_delete_line"/>
|
||||
</menu>
|
||||
@ -1,14 +0,0 @@
|
||||
<?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>
|
||||
@ -113,7 +113,6 @@
|
||||
<string name="text_release_notes">Release Notes</string>
|
||||
|
||||
<string name="text_update">Update</string>
|
||||
<string name="text_task_manage">Tasks</string>
|
||||
<string name="text_processing">Processing</string>
|
||||
<string name="text_pre_execute_script">Pre-execute script</string>
|
||||
<string name="text_check_for_updates">Check for updates</string>
|
||||
|
||||
@ -1,12 +1,5 @@
|
||||
<resources>
|
||||
|
||||
<style name="AppTheme.NoActionBar">
|
||||
<item name="windowActionBar">false</item>
|
||||
<item name="windowNoTitle">true</item>
|
||||
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
|
||||
<item name="android:statusBarColor">@android:color/transparent</item>
|
||||
</style>
|
||||
|
||||
|
||||
<style name="AppTheme.FullScreen" parent="AppTheme">
|
||||
<item name="windowNoTitle">true</item>
|
||||
|
||||
@ -2,17 +2,13 @@
|
||||
<string name="air_title_report_issue">错误报告</string>
|
||||
|
||||
<string name="air_title_issue">问题</string>
|
||||
<string name="air_title_login">登录</string>
|
||||
|
||||
<string name="air_label_issue_title">标题</string>
|
||||
<string name="air_label_issue_description">描述</string>
|
||||
<string name="air_label_device_info">设备信息</string>
|
||||
|
||||
<string name="air_label_use_account">使用Github账号发送</string>
|
||||
<string name="air_label_use_email">使用Email发送</string>
|
||||
<string name="air_label_use_guest">匿名发送</string>
|
||||
<string name="air_label_username">用户名</string>
|
||||
<string name="air_label_password">密码</string>
|
||||
<string name="air_label_email">邮箱</string>
|
||||
<string name="air_label_email_optional">联系邮箱 (选填)</string>
|
||||
|
||||
|
||||
@ -106,7 +106,6 @@
|
||||
<string name="key_use_volume_control_running">key_use_volume_control_running</string>
|
||||
<string name="text_use_volume_to_stop_running">音量上键停止所有脚本</string>
|
||||
<string name="text_need_to_enable_accessibility_service">需要启用无障碍服务</string>
|
||||
<string name="text_task_manage">任务管理</string>
|
||||
<string name="text_name_should_not_be_empty">名称不能为空</string>
|
||||
<string name="text_import_fail">导入失败</string>
|
||||
<string name="text_no_brower">没有浏览器耶o(╯□╰)o快去安装一个吧</string>
|
||||
@ -196,7 +195,6 @@
|
||||
<string name="text_others">其他</string>
|
||||
<string name="text_import">导入</string>
|
||||
<string name="text_click_too_frequently">您的操作太快啦ヽ(#`Д´)ノ</string>
|
||||
<string name="text_connecting">连接中…</string>
|
||||
<string name="text_username">用户名</string>
|
||||
<string name="text_password">密码</string>
|
||||
<string name="text_login">登录</string>
|
||||
@ -281,17 +279,11 @@
|
||||
<string name="text_reset_fail">重置失败</string>
|
||||
<string name="text_reset_succeed">重置成功</string>
|
||||
<string name="text_cannot_read_file" formatted="true">无法读取文件: %s</string>
|
||||
<string name="text_connected">已连接</string>
|
||||
<string name="text_service">服务</string>
|
||||
<string name="text_notification_permission">通知权限</string>
|
||||
|
||||
|
||||
|
||||
<string name="title_activity_log">LogActivity</string>
|
||||
<string name="text_open_main_activity">打开主界面</string>
|
||||
<string name="text_select_all">全选</string>
|
||||
<string name="text_cut">剪切</string>
|
||||
<string name="text_copy">复制</string>
|
||||
<string name="text_generate_code">生成代码</string>
|
||||
<string name="text_action">动作</string>
|
||||
<string name="text_click">点击(click)</string>
|
||||
|
||||
@ -43,10 +43,6 @@
|
||||
</style>
|
||||
|
||||
|
||||
<style name="MainToolbarTheme" parent="AppTheme">
|
||||
<item name="android:textColorSecondary">#c4c4c4</item>
|
||||
</style>
|
||||
|
||||
<style name="IssueReporterTheme" parent="Theme.AppCompat.Light.NoActionBar">
|
||||
<item name="colorPrimary">@color/colorPrimary</item>
|
||||
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
|
||||
@ -57,18 +53,8 @@
|
||||
|
||||
</style>
|
||||
|
||||
<style name="AppTheme.NoActionBar">
|
||||
<item name="windowActionBar">false</item>
|
||||
<item name="windowNoTitle">true</item>
|
||||
</style>
|
||||
|
||||
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar"/>
|
||||
|
||||
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar"/>
|
||||
|
||||
<style name="AppTheme.Console" parent="Theme.AppCompat.Light.DarkActionBar">
|
||||
<!-- Customize your theme here. -->
|
||||
<item name="colorButtonNormal">#cc181818</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
||||
|
||||
@ -48,7 +48,7 @@ dependencies {
|
||||
})
|
||||
compile 'com.android.support:design:25.4.0'
|
||||
compile 'com.android.support:appcompat-v7:25.4.0'
|
||||
compile 'com.github.hyb1996:EnhancedFloaty:0.17'
|
||||
compile 'com.github.hyb1996:EnhancedFloaty:0.21'
|
||||
compile 'com.github.hyb1996:OpenCvLib:2.4.13.4-imgproc'
|
||||
compile 'com.makeramen:roundedimageview:2.3.0'
|
||||
// OkHttp
|
||||
|
||||
@ -39,7 +39,7 @@ module.exports = function(__runtime__, scope){
|
||||
}
|
||||
|
||||
console.show = rtConsole.show.bind(rtConsole);
|
||||
console.hide = rtConsole.show.bind(rtConsole);
|
||||
console.hide = rtConsole.hide.bind(rtConsole);
|
||||
console.clear = rtConsole.clear.bind(rtConsole);
|
||||
console.setTitle = rtConsole.setTitle.bind(rtConsole);
|
||||
|
||||
|
||||
@ -163,6 +163,7 @@ module.exports = function(runtime, scope){
|
||||
r.body = {};
|
||||
var body = res.body();
|
||||
r.body.string = body.string.bind(body);
|
||||
r.body.bytes = body.bytes.bind(body);
|
||||
r.body.json = function(){
|
||||
return JSON.parse(r.body.string());
|
||||
}
|
||||
|
||||
@ -26,7 +26,6 @@ public class ExampleUnitTest {
|
||||
|
||||
@Test
|
||||
public void test() throws IOException {
|
||||
MimeTypeMap.getSingleton().getMimeTypeFromExtension();
|
||||
File file = new File("C:\\Users\\Stardust\\Desktop\\1.txt");
|
||||
System.out.println(PFiles.read(file));
|
||||
String url = "http://posttestserver.com/post.php?dir=example";
|
||||
|
||||
Loading…
Reference in New Issue
Block a user