add: jump, find, replace, copy, paste for editor
BIN
app/src/main/res/drawable-hdpi/ic_close_white_48dp.png
Normal file
|
After Width: | Height: | Size: 347 B |
BIN
app/src/main/res/drawable-mdpi/ic_close_white_48dp.png
Normal file
|
After Width: | Height: | Size: 257 B |
BIN
app/src/main/res/drawable-xhdpi/ic_close_white_48dp.png
Normal file
|
After Width: | Height: | Size: 436 B |
BIN
app/src/main/res/drawable-xxhdpi/ic_close_white_48dp.png
Normal file
|
After Width: | Height: | Size: 524 B |
BIN
app/src/main/res/drawable-xxxhdpi/ic_close_white_48dp.png
Normal file
|
After Width: | Height: | Size: 707 B |
BIN
app/src/main/res/drawable/ic_ali_down.png
Normal file
|
After Width: | Height: | Size: 814 B |
BIN
app/src/main/res/drawable/ic_ali_replace.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
app/src/main/res/drawable/ic_ali_up.png
Normal file
|
After Width: | Height: | Size: 813 B |
|
Before Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 1.7 KiB |
69
app/src/main/res/layout/dialog_find_or_replace.xml
Normal file
@@ -0,0 +1,69 @@
|
||||
<?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:paddingLeft="16dp"
|
||||
android:paddingRight="16dp"
|
||||
android:paddingTop="16dp">
|
||||
|
||||
<android.support.design.widget.TextInputLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<android.support.design.widget.TextInputEditText
|
||||
android:id="@+id/keywords"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/text_find"/>
|
||||
</android.support.design.widget.TextInputLayout>
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/checkbox_regex"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/text_regex"/>
|
||||
|
||||
<android.support.design.widget.TextInputLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<android.support.design.widget.TextInputEditText
|
||||
android:id="@+id/replacement"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/text_replace"/>
|
||||
</android.support.design.widget.TextInputLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/checkbox_replace"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/text_replace"/>
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/checkbox_replace_all"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/text_replace_all"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="4dp"
|
||||
android:text="@string/hint_regex"
|
||||
android:textColor="#929397"
|
||||
android:textSize="12sp"/>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
@@ -10,6 +10,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:theme="@style/AppTheme.AppBarOverlay">
|
||||
|
||||
|
||||
<com.stardust.theme.widget.ThemeColorToolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
@@ -18,46 +19,92 @@
|
||||
android:title="@string/_app_name"
|
||||
app:popupTheme="@style/AppTheme.PopupOverlay">
|
||||
|
||||
<LinearLayout
|
||||
<com.stardust.widget.ViewSwitcher
|
||||
android:id="@+id/toolbar_switcher"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="right"
|
||||
android:orientation="horizontal">
|
||||
android:layout_gravity="right">
|
||||
|
||||
<com.stardust.widget.ToolbarMenuItem
|
||||
android:id="@+id/run"
|
||||
android:layout_width="40dp"
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
app:icon="@drawable/ic_play_arrow_white_48dp"
|
||||
app:icon_color="@android:color/white"
|
||||
app:text="@string/text_run"/>
|
||||
android:layout_gravity="right"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<com.stardust.widget.ToolbarMenuItem
|
||||
android:id="@+id/undo"
|
||||
android:layout_width="40dp"
|
||||
<com.stardust.widget.ToolbarMenuItem
|
||||
android:id="@+id/run"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="match_parent"
|
||||
app:icon="@drawable/ic_play_arrow_white_48dp"
|
||||
app:icon_color="@android:color/white"
|
||||
app:text="@string/text_run"/>
|
||||
|
||||
<com.stardust.widget.ToolbarMenuItem
|
||||
android:id="@+id/undo"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="match_parent"
|
||||
app:icon="@drawable/ic_undo_white_48dp"
|
||||
app:text="@string/text_undo"/>
|
||||
|
||||
<com.stardust.widget.ToolbarMenuItem
|
||||
android:id="@+id/redo"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="match_parent"
|
||||
app:icon="@drawable/ic_redo_white_48dp"
|
||||
app:text="@string/text_redo"/>
|
||||
|
||||
<com.stardust.widget.ToolbarMenuItem
|
||||
android:id="@+id/save"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="match_parent"
|
||||
app:icon="@drawable/ic_save_white_48dp"
|
||||
app:text="@string/text_save"/>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
app:icon="@drawable/ic_undo_white_48dp"
|
||||
app:text="@string/text_undo"/>
|
||||
android:layout_gravity="right"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<com.stardust.widget.ToolbarMenuItem
|
||||
android:id="@+id/redo"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="match_parent"
|
||||
app:icon="@drawable/ic_redo_white_48dp"
|
||||
app:text="@string/text_redo"/>
|
||||
<com.stardust.widget.ToolbarMenuItem
|
||||
android:id="@+id/replace"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="match_parent"
|
||||
app:icon="@drawable/ic_ali_replace"
|
||||
app:text="@string/text_replace"/>
|
||||
|
||||
<com.stardust.widget.ToolbarMenuItem
|
||||
android:id="@+id/save"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="match_parent"
|
||||
app:icon="@drawable/ic_save_white_48dp"
|
||||
app:text="@string/text_save"/>
|
||||
<com.stardust.widget.ToolbarMenuItem
|
||||
android:id="@+id/find_prev"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="match_parent"
|
||||
app:icon="@drawable/ic_ali_up"
|
||||
app:text="@string/text_find_prev"/>
|
||||
|
||||
<com.stardust.widget.ToolbarMenuItem
|
||||
android:id="@+id/find_next"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="match_parent"
|
||||
app:icon="@drawable/ic_ali_down"
|
||||
app:text="@string/text_find_next"/>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
<com.stardust.widget.ToolbarMenuItem
|
||||
android:id="@+id/cancel"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="match_parent"
|
||||
app:icon="@drawable/ic_close_white_48dp"
|
||||
app:text="@string/text_cancel"/>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
</com.stardust.widget.ViewSwitcher>
|
||||
|
||||
</com.stardust.theme.widget.ThemeColorToolbar>
|
||||
|
||||
|
||||
</android.support.design.widget.AppBarLayout>
|
||||
|
||||
|
||||
|
||||
@@ -3,39 +3,86 @@
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<item
|
||||
android:id="@+id/action_beautify"
|
||||
android:orderInCategory="100"
|
||||
android:title="@string/text_code_beautify"
|
||||
android:id="@+id/action_force_stop"
|
||||
android:title="@string/text_force_stop"
|
||||
app:showAsAction="never"/>
|
||||
|
||||
<item android:title="@string/text_edit">
|
||||
|
||||
<menu>
|
||||
|
||||
<item
|
||||
android:id="@+id/action_find_or_replace"
|
||||
android:title="@string/text_find_or_replace"
|
||||
app:showAsAction="never"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/action_copy_all"
|
||||
android:title="@string/text_copy_all"
|
||||
app:showAsAction="never"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/action_paste"
|
||||
android:title="@string/text_paste"
|
||||
app:showAsAction="never"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/action_copy_line"
|
||||
android:title="@string/text_copy_line"
|
||||
app:showAsAction="never"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/action_delete_line"
|
||||
android:title="@string/text_delete_line"
|
||||
app:showAsAction="never"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/action_clear"
|
||||
android:title="@string/text_clear"
|
||||
app:showAsAction="never"/>
|
||||
|
||||
</menu>
|
||||
|
||||
</item>
|
||||
|
||||
<item
|
||||
android:id="@+id/action_jump"
|
||||
android:title="@string/text_jump_to_line"
|
||||
app:showAsAction="never"/>
|
||||
|
||||
|
||||
<item
|
||||
android:id="@+id/action_console"
|
||||
android:orderInCategory="200"
|
||||
android:title="@string/text_console"
|
||||
app:showAsAction="never"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/action_force_stop"
|
||||
android:orderInCategory="250"
|
||||
android:title="@string/text_force_stop"
|
||||
app:showAsAction="never"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/action_log"
|
||||
android:orderInCategory="280"
|
||||
android:title="@string/text_log"
|
||||
app:showAsAction="never"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/action_editor_theme"
|
||||
android:orderInCategory="300"
|
||||
android:title="@string/text_editor_theme"
|
||||
app:showAsAction="never"/>
|
||||
<item android:title="@string/text_more">
|
||||
<menu>
|
||||
|
||||
<item
|
||||
android:id="@+id/action_open_by_other_apps"
|
||||
android:orderInCategory="400"
|
||||
android:title="@string/text_open_by_other_apps"
|
||||
app:showAsAction="never"/>
|
||||
<item
|
||||
android:id="@+id/action_beautify"
|
||||
android:title="@string/text_code_beautify"
|
||||
app:showAsAction="never"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/action_info"
|
||||
android:title="@string/text_info"
|
||||
app:showAsAction="never"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/action_editor_theme"
|
||||
android:title="@string/text_editor_theme"
|
||||
app:showAsAction="never"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/action_open_by_other_apps"
|
||||
android:title="@string/text_open_by_other_apps"
|
||||
app:showAsAction="never"/>
|
||||
</menu>
|
||||
</item>
|
||||
</menu>
|
||||
@@ -254,6 +254,22 @@
|
||||
<string name="text_type">类型</string>
|
||||
<string name="text_donate">捐赠</string>
|
||||
<string name="text_editor_theme">编辑器主题</string>
|
||||
<string name="text_util">工具</string>
|
||||
<string name="text_jump_to_line">跳转到行</string>
|
||||
<string name="text_info">信息</string>
|
||||
<string name="text_find_or_replace">查找/替换</string>
|
||||
<string name="text_paste">粘贴</string>
|
||||
<string name="text_copy_all">复制全部</string>
|
||||
<string name="text_copy_line">复制行</string>
|
||||
<string name="text_delete_line">删除行</string>
|
||||
<string name="format_editor_info" formatted="false">字符数: %d\n行数: %d\n大小: %s</string>
|
||||
<string name="text_find">查找</string>
|
||||
<string name="text_replace">替换</string>
|
||||
<string name="text_regex">正则表达式</string>
|
||||
<string name="text_replace_all">全部替换</string>
|
||||
<string name="text_find_next">向下</string>
|
||||
<string name="text_find_prev">向上</string>
|
||||
<string name="hint_regex">正则语法与JavaScript中相同, 可使用$1-9代替被捕获的匹配</string>
|
||||
|
||||
|
||||
<string-array name="record_control_keys">
|
||||
|
||||