mirror of
https://github.com/TonyJiangWJ/Auto.js.git
synced 2026-06-21 21:01:43 +08:00
adjust editor menu
This commit is contained in:
parent
f6e0b0d806
commit
0f35fe3a3a
@ -49,9 +49,6 @@ public class EditorMenu {
|
||||
if (onEditOptionsSelected(item)) {
|
||||
return true;
|
||||
}
|
||||
if (onRefactorOptionsSelected(item)) {
|
||||
return true;
|
||||
}
|
||||
if (onJumpOptionsSelected(item)) {
|
||||
return true;
|
||||
}
|
||||
@ -83,30 +80,12 @@ public class EditorMenu {
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean onRefactorOptionsSelected(MenuItem item) {
|
||||
switch (item.getItemId()) {
|
||||
case R.id.action_beautify:
|
||||
beautifyCode();
|
||||
return true;
|
||||
case R.id.action_rename:
|
||||
//mEditor.rename();
|
||||
return true;
|
||||
case R.id.action_select_variable:
|
||||
//mEditor.selectName();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
private boolean onMoreOptionsSelected(MenuItem item) {
|
||||
switch (item.getItemId()) {
|
||||
case R.id.action_console:
|
||||
showConsole();
|
||||
return true;
|
||||
case R.id.action_show_type:
|
||||
// mEditor.showType();
|
||||
return true;
|
||||
case R.id.action_editor_theme:
|
||||
mEditorView.selectEditorTheme();
|
||||
return true;
|
||||
@ -139,9 +118,6 @@ public class EditorMenu {
|
||||
case R.id.action_copy_all:
|
||||
copyAll();
|
||||
return true;
|
||||
case R.id.action_paste:
|
||||
paste();
|
||||
return true;
|
||||
case R.id.action_copy_line:
|
||||
copyLine();
|
||||
return true;
|
||||
@ -151,6 +127,9 @@ public class EditorMenu {
|
||||
case R.id.action_clear:
|
||||
mEditor.setText("");
|
||||
return true;
|
||||
case R.id.action_beautify:
|
||||
beautifyCode();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -178,6 +178,8 @@ public class CodeEditor extends HVScrollView {
|
||||
}
|
||||
mProcessDialog = new MaterialDialog.Builder(getContext())
|
||||
.content(R.string.text_processing)
|
||||
.progress(true, 0)
|
||||
.cancelable(false)
|
||||
.show();
|
||||
} else {
|
||||
if (mProcessDialog != null) {
|
||||
|
||||
@ -21,11 +21,6 @@
|
||||
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"
|
||||
@ -41,6 +36,11 @@
|
||||
android:title="@string/text_clear"
|
||||
app:showAsAction="never"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/action_beautify"
|
||||
android:title="@string/text_code_beautify"
|
||||
app:showAsAction="never"/>
|
||||
|
||||
</menu>
|
||||
|
||||
</item>
|
||||
@ -85,43 +85,22 @@
|
||||
</item>
|
||||
|
||||
|
||||
<item android:title="@string/text_refactor">
|
||||
<menu>
|
||||
<item
|
||||
android:id="@+id/action_rename"
|
||||
android:title="@string/text_rename"
|
||||
app:showAsAction="never"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/action_select_variable"
|
||||
android:title="@string/text_select_variable"
|
||||
app:showAsAction="never"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/action_beautify"
|
||||
android:title="@string/text_code_beautify"
|
||||
app:showAsAction="never"/>
|
||||
|
||||
</menu>
|
||||
</item>
|
||||
|
||||
<item
|
||||
android:id="@+id/action_log"
|
||||
android:title="@string/text_log"
|
||||
app:showAsAction="never"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/action_build_apk"
|
||||
android:title="@string/text_build_apk"
|
||||
app:showAsAction="never"/>
|
||||
|
||||
<item android:title="@string/text_more">
|
||||
<menu>
|
||||
<item
|
||||
android:id="@+id/action_console"
|
||||
android:title="@string/text_console"
|
||||
app:showAsAction="never"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/action_show_type"
|
||||
android:title="@string/text_show_type"
|
||||
app:showAsAction="never"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/action_info"
|
||||
android:title="@string/text_info"
|
||||
@ -137,10 +116,6 @@
|
||||
android:title="@string/text_open_by_other_apps"
|
||||
app:showAsAction="never"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/action_build_apk"
|
||||
android:title="@string/text_build_apk"
|
||||
app:showAsAction="never"/>
|
||||
</menu>
|
||||
</item>
|
||||
</menu>
|
||||
Loading…
Reference in New Issue
Block a user