refactor: implements DrawerMenu with RecyclerView
This commit is contained in:
@@ -1,9 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<size
|
||||
android:width="100dp"
|
||||
android:height="6dp"/>
|
||||
|
||||
<solid android:color="#f0f1f5"/>
|
||||
</shape>
|
||||
@@ -1,110 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ScrollView 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">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:divider="@drawable/drawer_menu_divider"
|
||||
android:orientation="vertical"
|
||||
android:showDividers="middle">
|
||||
|
||||
<com.stardust.scriptdroid.ui.main.drawer.DrawerMenuGroup
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:title="@string/text_service">
|
||||
|
||||
<com.stardust.scriptdroid.ui.main.drawer.DrawerMenuItem
|
||||
android:id="@+id/accessibility_service"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:anti_shake="true"
|
||||
app:icon="@drawable/ic_service_green"
|
||||
app:title="@string/text_accessibility_service"
|
||||
app:with_switch="true"/>
|
||||
|
||||
<com.stardust.scriptdroid.ui.main.drawer.DrawerMenuItem
|
||||
android:id="@+id/stable_mode"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:icon="@drawable/ic_stable"
|
||||
app:pref_key="@string/key_stable_mode"
|
||||
app:title="@string/text_stable_mode"
|
||||
app:with_switch="true"/>
|
||||
|
||||
<com.stardust.scriptdroid.ui.main.drawer.DrawerMenuItem
|
||||
android:id="@+id/notification_service"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:icon="@drawable/ic_ali_notification"
|
||||
app:title="@string/text_notification_permission"
|
||||
app:with_switch="true"/>
|
||||
|
||||
|
||||
</com.stardust.scriptdroid.ui.main.drawer.DrawerMenuGroup>
|
||||
|
||||
<com.stardust.scriptdroid.ui.main.drawer.DrawerMenuGroup
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:title="@string/text_script_record">
|
||||
|
||||
|
||||
<com.stardust.scriptdroid.ui.main.drawer.DrawerMenuItem
|
||||
android:id="@+id/floating_window"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:anti_shake="true"
|
||||
app:icon="@drawable/ic_robot_64"
|
||||
app:title="@string/text_floating_window"
|
||||
app:with_switch="true"/>
|
||||
|
||||
<com.stardust.scriptdroid.ui.main.drawer.DrawerMenuItem
|
||||
android:id="@+id/volume_down_control"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:icon="@drawable/ic_volume"
|
||||
app:pref_key="@string/key_use_volume_control_record"
|
||||
app:title="@string/text_volume_down_control"
|
||||
app:with_switch="true"/>
|
||||
|
||||
|
||||
</com.stardust.scriptdroid.ui.main.drawer.DrawerMenuGroup>
|
||||
|
||||
|
||||
<com.stardust.scriptdroid.ui.main.drawer.DrawerMenuGroup
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:title="@string/text_others">
|
||||
|
||||
<com.stardust.scriptdroid.ui.main.drawer.DrawerMenuItem
|
||||
android:id="@+id/debug"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:anti_shake="true"
|
||||
app:icon="@drawable/ic_debug"
|
||||
app:title="@string/debug"
|
||||
app:with_switch="true"/>
|
||||
|
||||
<com.stardust.scriptdroid.ui.main.drawer.DrawerMenuItem
|
||||
android:id="@+id/theme_color"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:icon="@drawable/ic_personalize"
|
||||
app:title="@string/text_theme_color"/>
|
||||
|
||||
<com.stardust.scriptdroid.ui.main.drawer.DrawerMenuItem
|
||||
android:id="@+id/check_for_updates"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:icon="@drawable/ic_check_for_updates"
|
||||
app:title="@string/text_check_for_updates"/>
|
||||
|
||||
</com.stardust.scriptdroid.ui.main.drawer.DrawerMenuGroup>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</ScrollView>
|
||||
18
app/src/main/res/layout/drawer_menu_group.xml
Normal file
18
app/src/main/res/layout/drawer_menu_group.xml
Normal file
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="#f0f1f5"
|
||||
android:paddingTop="@dimen/divider_drawer_menu_group">
|
||||
|
||||
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="#ffffff"
|
||||
android:padding="8dp"
|
||||
android:textColor="#999999"
|
||||
android:textSize="12sp">
|
||||
|
||||
</TextView>
|
||||
</FrameLayout>
|
||||
@@ -1,60 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<com.stardust.scriptdroid.ui.edit.EditorView_
|
||||
android:id="@+id/editor_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<com.stardust.scriptdroid.ui.widget.ToolbarMenuItem
|
||||
android:id="@+id/close"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="match_parent"
|
||||
app:icon="@drawable/ic_close_white_48dp"
|
||||
app:text="@string/text_close"/>
|
||||
|
||||
<com.stardust.scriptdroid.ui.widget.ToolbarMenuItem
|
||||
android:id="@+id/move_or_resize"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="match_parent"
|
||||
app:icon="@drawable/ic_settings_ethernet_white_24dp"
|
||||
app:text="@string/text_adjust"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<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_cool_black"
|
||||
android:padding="6dp"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/ic_resizer"
|
||||
android:tint="@android:color/white"
|
||||
android:visibility="gone"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/move_cursor"
|
||||
android:layout_width="25dp"
|
||||
android:layout_height="25dp"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentTop="true"
|
||||
android:background="@drawable/circle_cool_black"
|
||||
android:padding="5dp"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@drawable/ic_move_cursor"
|
||||
android:tint="@android:color/white"
|
||||
android:visibility="gone"/>
|
||||
|
||||
</RelativeLayout>
|
||||
@@ -63,12 +63,13 @@
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<include
|
||||
layout="@layout/drawer_menu"
|
||||
<android.support.v7.widget.RecyclerView
|
||||
android:id="@+id/drawer_menu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"/>
|
||||
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
|
||||
@@ -5,10 +5,6 @@
|
||||
android:id="@+id/run_repeatedly"
|
||||
android:title="@string/text_run_repeatedly"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/floating_edit"
|
||||
android:title="@string/text_floating_edit"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/create_shortcut"
|
||||
android:title="@string/text_send_shortcut"/>
|
||||
|
||||
@@ -26,10 +26,6 @@
|
||||
android:id="@+id/timed_task"
|
||||
android:title="@string/text_timed_task"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/floating_edit"
|
||||
android:title="@string/text_floating_edit"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/create_shortcut"
|
||||
android:title="@string/text_send_shortcut"/>
|
||||
|
||||
@@ -88,7 +88,6 @@
|
||||
<string name="text_help">Help</string>
|
||||
<string name="text_no_floating_window_permission">No floating window permission</string>
|
||||
<string name="text_no_accessibility_permission_to_capture">Accessibility service is not activated</string>
|
||||
<string name="text_reset_background">Reset background settings</string>
|
||||
<string name="text_record_msg">Recording Prompt</string>
|
||||
<string name="text_text_changed">Text Changed</string>
|
||||
<string name="text_scrolled">Scrolled</string>
|
||||
@@ -116,7 +115,6 @@
|
||||
<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>
|
||||
<string name="text_already_reset">已重置</string>
|
||||
<string name="text_layout_inspector_is_dumping">布局分析中,请稍后点击</string>
|
||||
|
||||
</resources>
|
||||
|
||||
@@ -7,6 +7,6 @@
|
||||
<dimen name="script_and_folder_list_divider_left_margin">0dp</dimen>
|
||||
<dimen name="script_and_folder_list_divider_right_margin">0dp</dimen>
|
||||
<dimen name="fab_margin">16dp</dimen>
|
||||
<dimen name="padding_item_property">8dp</dimen>
|
||||
<dimen name="textSize_item_property">14sp</dimen>
|
||||
<dimen name="divider_drawer_menu_group">6dp</dimen>
|
||||
</resources>
|
||||
|
||||
@@ -91,7 +91,6 @@
|
||||
<string name="text_help">帮助</string>
|
||||
<string name="text_no_floating_window_permission">没有悬浮窗权限</string>
|
||||
<string name="text_no_accessibility_permission_to_capture">无障碍服务未启动</string>
|
||||
<string name="text_reset_background">重置背景图片设置</string>
|
||||
<string name="text_record_msg">录制提示</string>
|
||||
<string name="text_text_changed">文字改变</string>
|
||||
<string name="text_scrolled">滑动</string>
|
||||
@@ -133,7 +132,6 @@
|
||||
<string name="text_do_not_ask_again_for_this_version">此版本不再提示</string>
|
||||
<string name="text_code_beautify">格式化代码</string>
|
||||
<string name="text_processing">处理中</string>
|
||||
<string name="text_already_reset">已重置</string>
|
||||
<string name="text_guard_mode">保护模式</string>
|
||||
<string name="summary_guard_mode">在本软件界面无法运行自动操作命令以免误触</string>
|
||||
<string name="key_guard_mode">key_guard_mode</string>
|
||||
@@ -230,10 +228,7 @@
|
||||
<string name="text_refactor">重构</string>
|
||||
<string name="text_select_variable">选择变量</string>
|
||||
<string name="text_show_type">显示变量类型</string>
|
||||
<string name="text_close">关闭</string>
|
||||
<string name="text_adjust">调整</string>
|
||||
<string name="text_exit_floating_window">退出悬浮窗</string>
|
||||
<string name="text_save_and_edit">下载并编辑</string>
|
||||
<string name="text_select_save_path">保存到</string>
|
||||
<string name="text_cancel_download">取消下载</string>
|
||||
<string name="text_download">下载</string>
|
||||
@@ -259,7 +254,6 @@
|
||||
<string name="apk_builder_clean">清理临时文件</string>
|
||||
<string name="text_source_file_path">脚本文件路径</string>
|
||||
<string name="text_search">搜索</string>
|
||||
<string name="text_floating_edit">悬浮编辑</string>
|
||||
<string name="text_select_icon">选择图标</string>
|
||||
<string name="text_use_android_n_shortcut">添加到安卓7.0 Shortcut</string>
|
||||
<string name="text_login_succeed">登录成功</string>
|
||||
@@ -300,7 +294,6 @@
|
||||
<string name="text_using_text_selector">使用文本选择(text)</string>
|
||||
<string name="text_using_desc_selector">使用描述选择(desc)</string>
|
||||
<string name="text_generate">生成</string>
|
||||
<string name="text_generate_and_open_editor">生成并打开编辑器</string>
|
||||
<string name="text_generate_fail">生成失败了o(╥﹏╥)o</string>
|
||||
<string name="key_documentation_source">key_documentation_source</string>
|
||||
<string name="text_documentation_source">文档源</string>
|
||||
|
||||
Reference in New Issue
Block a user