add: slide menu

This commit is contained in:
hyb1996
2017-01-31 22:41:04 +08:00
parent b47eaf9d5e
commit 853a518d97
51 changed files with 1214 additions and 299 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

@@ -5,13 +5,13 @@
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context="com.stardust.scriptdroid.MainActivity">
<android.support.design.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
android:fitsSystemWindows="true">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
@@ -55,16 +55,17 @@
android:orientation="vertical">
<ImageView
android:layout_width="600dp"
android:layout_width="60dp"
android:layout_height="60dp"
android:src="@drawable/ic_create_new_folder_black_48dp"/>
android:padding="10dp"
android:src="@drawable/ic_add_file_green"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/text_new_file"
android:textColor="@android:color/secondary_text_light"
android:textColor="@color/colorPrimary"
android:textSize="16sp"/>
</LinearLayout>
@@ -83,14 +84,14 @@
android:layout_width="60dp"
android:layout_height="60dp"
android:padding="10dp"
android:src="@drawable/ic_sdcard_black"/>
android:src="@drawable/ic_folder_open_outline_green"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/text_import_from_file"
android:textColor="@android:color/secondary_text_light"
android:textColor="@color/colorPrimary"
android:textSize="16sp"/>
</LinearLayout>
@@ -102,9 +103,10 @@
</android.support.design.widget.CoordinatorLayout>
<include
layout="@layout/slide_menu"
android:layout_width="280dp"
layout="@layout/drawer"
android:layout_width="304dp"
android:layout_height="match_parent"
android:layout_gravity="start"/>
android:layout_gravity="start"
/>
</android.support.v4.widget.DrawerLayout>

View File

@@ -0,0 +1,117 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/white"
android:clickable="true"
android:fitsSystemWindows="false"
android:importantForAccessibility="no"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="180dp"
android:layout_marginBottom="5dp">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="fitXY"
android:src="@drawable/slide_menu_img"/>
<TextView
android:id="@+id/version"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginBottom="8dp"
android:layout_marginLeft="8dp"
android:gravity="center"
android:text="@string/version"
android:textColor="@android:color/white"
android:textSize="14sp"/>
<TextView
android:id="@+id/app_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@id/version"
android:layout_marginLeft="8dp"
android:gravity="center"
android:text="@string/app_name"
android:textColor="@android:color/white"
android:textSize="28sp"/>
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<FrameLayout
android:id="@+id/fragment_slide_menu"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_gravity="bottom">
<LinearLayout
android:id="@+id/setting"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="?selectableItemBackground"
android:gravity="center"
android:orientation="horizontal">
<ImageView
android:layout_width="40dp"
android:layout_height="40dp"
android:padding="6dp"
android:src="@drawable/ic_settings_applications_green_48dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/text_setting"
android:textSize="15sp"/>
</LinearLayout>
<LinearLayout
android:id="@+id/exit"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="?selectableItemBackground"
android:gravity="center"
android:orientation="horizontal">
<ImageView
android:layout_width="40dp"
android:layout_height="40dp"
android:padding="6dp"
android:src="@drawable/ic_exit_to_app_green_48dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/text_exit"
android:textSize="15sp"/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>

View File

@@ -0,0 +1,129 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<RelativeLayout
android:id="@+id/auto_operate_service"
android:layout_width="match_parent"
android:layout_height="52dp"
android:background="?selectableItemBackground"
android:gravity="center_vertical">
<ImageView
android:id="@+id/icon_service"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_alignParentLeft="true"
android:layout_margin="16dp"
android:src="@drawable/ic_service_green"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_toRightOf="@id/icon_service"
android:gravity="center"
android:text="@string/text_auto_operate_service"
android:textColor="@android:color/primary_text_light"/>
<android.support.v7.widget.SwitchCompat
android:id="@+id/sw_auto_operate_service"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:layout_marginRight="16dp"/>
</RelativeLayout>
<LinearLayout
android:id="@+id/syntax_and_api"
android:layout_width="match_parent"
android:layout_height="52dp"
android:background="?selectableItemBackground"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_margin="16dp"
android:src="@drawable/ic_js"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center"
android:text="@string/text_syntax_and_api"
android:textColor="@android:color/primary_text_light"/>
</LinearLayout>
<LinearLayout
android:id="@+id/stop_all_running_scripts"
android:layout_width="match_parent"
android:layout_height="52dp"
android:background="?selectableItemBackground"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_margin="16dp"
android:src="@drawable/ic_close_green_48dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center"
android:text="@string/text_close_all_running_scripts"
android:textColor="@android:color/primary_text_light"/>
</LinearLayout>
<LinearLayout
android:id="@+id/about_app"
android:layout_width="match_parent"
android:layout_height="52dp"
android:background="?selectableItemBackground"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_margin="16dp"
android:src="@drawable/ic_about_us_green_100px"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center"
android:text="@string/text_about"
android:textColor="@android:color/primary_text_light"/>
</LinearLayout>
<LinearLayout
android:id="@+id/licenses"
android:layout_width="match_parent"
android:layout_height="52dp"
android:background="?selectableItemBackground"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_margin="16dp"
android:src="@drawable/ic_license_green"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center"
android:text="@string/text_licenses"
android:textColor="@android:color/primary_text_light"/>
</LinearLayout>
</LinearLayout>

View File

@@ -1,14 +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:background="@android:color/white"
android:orientation="vertical">
<ImageView
android:layout_width="match_parent"
android:layout_height="156dp"
android:scaleType="fitXY"
android:src="@drawable/slide_menu_img"/>
</LinearLayout>

View File

@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<notices>
<notice>
<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>
<name>Gson</name>
<url>https://github.com/google/gson</url>
<copyright>Copyright 2008 Google Inc.</copyright>
<license>Apache Software License 2.0</license>
</notice>
</notices>

View File

@@ -0,0 +1,23 @@
function openRunningServices(){
launch("com.android.settings");
var i = 0;
while(!click("开发者选项")){
i++;
if(i == 10){
toast("开发者选项未开启");
return;
}
scrollDown();
}
while(!click("正在运行的服务"));
}
importClass("android.os.Build.VERSION");
if(VERSION.SDK_INT < 23){
toast("本代码只适用于Android6.0以上");
}else{
openRunningServices();
}

View File

@@ -0,0 +1,5 @@
launchApp("微信");
sleep(500);
click("发现");
sleep(500);
click("朋友圈");

View File

@@ -0,0 +1,7 @@
importClass("com.afollestad.materialdialogs.MaterialDialog");
new MaterialDialog.Builder(context)
.title("请输入算式")
.contenet("测试")
.show();

View File

@@ -2,7 +2,7 @@
<string name="app_name">免Root脚本机器人</string>
<string name="action_settings">设置</string>
<string name="action_disable_service">关闭服务</string>
<string name="text_accesibility_service_description">略略略</string>
<string name="text_accessibility_service_description">使脚本自动操作(点击、长按、滑动等)所需,若关闭则只能执行不涉及自动操作的脚本。</string>
<string name="text_new_file">新建文件</string>
<string name="text_import_from_file">从文件导入</string>
<string name="action_exit">退出</string>
@@ -12,13 +12,13 @@
<string name="text_please_input_name">请输入名称</string>
<string name="text_name">名称</string>
<string name="text_go_to_setting">去设置</string>
<string name="explain_accessibility_permission">软件需要权限才能运行 ~ 请在随后的设置中选择”脚本执行机器人\"并开启权限</string>
<string name="explain_accessibility_permission">软件需要打开\"自动操作服务\"才能运行请在随后的设置中选择\"免Root脚本机器人\"并开启服务。\n您也可以稍后在侧拉菜单中设置。</string>
<string name="text_cancel">取消</string>
<string name="text_path_is_empty">路径为空</string>
<string name="text_file_not_exists">文件不存在</string>
<string name="text_no_file_rw_permission">无文件读写权限</string>
<string name="action_test">内嵌920测试</string>
<string name="text_no_accessibility_permission">辅助性服务未启动</string>
<string name="text_no_accessibility_permission">自动操作服务未启动,脚本已停止运行</string>
<string name="text_drawer_close">关闭侧拉菜单</string>
<string name="text_drawer_open">打开侧拉菜单</string>
<string name="text_undo">撤销</string>
@@ -29,4 +29,16 @@
<string name="edit_exit_without_save_warn">内容尚未保存,您确定要退出吗?</string>
<string name="text_save_and_exit">保存并退出</string>
<string name="text_exit_directly">直接退出</string>
<string name="text_setting">设置</string>
<string name="text_exit">退出</string>
<string name="text_auto_operate_service">自动操作服务</string>
<string name="version">Version 1.17.0130</string>
<string name="text_syntax_and_api">语法与API</string>
<string name="text_close_all_running_scripts">关闭所有正在运行的脚本</string>
<string name="text_about">关于</string>
<string name="text_licenses">开放源代码许可</string>
<string name="text_do_not_remind_again">不再提示</string>
<string name="text_sample_open_what_moment">示例:打开朋友圈</string>
<string name="text_sample_open_running_services">示例:打开正在运行的服务(安卓6.0+)</string>
<string name="text_sample_simple_calculator">示例:简单计算器</string>
</resources>

View File

@@ -1,7 +1,7 @@
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>

View File

@@ -4,5 +4,5 @@
android:accessibilityFeedbackType="feedbackGeneric"
android:accessibilityFlags="flagIncludeNotImportantViews|flagReportViewIds|flagRetrieveInteractiveWindows"
android:canRetrieveWindowContent="true"
android:description="@string/text_accesibility_service_description"
android:description="@string/text_accessibility_service_description"
android:notificationTimeout="100"/>