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