fix(ui): jump to line crash when line input is empty
This commit is contained in:
@@ -22,4 +22,6 @@ public class AccessibilityService extends com.stardust.view.accessibility.Access
|
|||||||
setServiceInfo(serviceInfo);
|
setServiceInfo(serviceInfo);
|
||||||
super.onServiceConnected();
|
super.onServiceConnected();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package org.autojs.autojs.ui.edit;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.support.design.widget.Snackbar;
|
import android.support.design.widget.Snackbar;
|
||||||
import android.text.InputType;
|
import android.text.InputType;
|
||||||
|
import android.text.TextUtils;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
|
|
||||||
import com.stardust.pio.PFiles;
|
import com.stardust.pio.PFiles;
|
||||||
@@ -56,7 +57,7 @@ public class EditorMenu {
|
|||||||
if (onMoreOptionsSelected(item)) {
|
if (onMoreOptionsSelected(item)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if(onDebugOptionsSelected(item)){
|
if (onDebugOptionsSelected(item)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -172,8 +173,14 @@ public class EditorMenu {
|
|||||||
new ThemeColorMaterialDialogBuilder(mContext)
|
new ThemeColorMaterialDialogBuilder(mContext)
|
||||||
.title(R.string.text_jump_to_line)
|
.title(R.string.text_jump_to_line)
|
||||||
.input(hint, "", (dialog, input) -> {
|
.input(hint, "", (dialog, input) -> {
|
||||||
int line = Integer.parseInt(input.toString());
|
if (TextUtils.isEmpty(input)) {
|
||||||
mEditor.jumpTo(line - 1, 0);
|
return;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
int line = Integer.parseInt(input.toString());
|
||||||
|
mEditor.jumpTo(line - 1, 0);
|
||||||
|
} catch (NumberFormatException ignored) {
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.inputType(InputType.TYPE_CLASS_NUMBER)
|
.inputType(InputType.TYPE_CLASS_NUMBER)
|
||||||
.show();
|
.show();
|
||||||
|
|||||||
Reference in New Issue
Block a user