fix: root_automator cannot be force stopped
This commit is contained in:
@@ -80,19 +80,15 @@ public class CircularMenu implements Recorder.OnStateChangedListener {
|
||||
}
|
||||
|
||||
private void setupListeners() {
|
||||
mWindow.setOnActionViewClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (mState == STATE_RECORDING) {
|
||||
stopRecord();
|
||||
} else if (mWindow.isExpanded()) {
|
||||
mWindow.collapse();
|
||||
} else {
|
||||
AutoJs.getInstance().getLayoutInspector().captureCurrentWindow();
|
||||
mWindow.expand();
|
||||
}
|
||||
mWindow.setOnActionViewClickListener(v -> {
|
||||
if (mState == STATE_RECORDING) {
|
||||
stopRecord();
|
||||
} else if (mWindow.isExpanded()) {
|
||||
mWindow.collapse();
|
||||
} else {
|
||||
AutoJs.getInstance().getLayoutInspector().captureCurrentWindow();
|
||||
mWindow.expand();
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
@@ -130,12 +126,7 @@ public class CircularMenu implements Recorder.OnStateChangedListener {
|
||||
.customView(listView, false)
|
||||
.positiveText(R.string.cancel)
|
||||
.build();
|
||||
listView.setOnItemOperatedListener(new ScriptListView.OnItemOperatedListener() {
|
||||
@Override
|
||||
public void OnItemOperated(ScriptFile file) {
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
listView.setOnItemOperatedListener(file -> dialog.dismiss());
|
||||
DialogUtils.showDialog(dialog);
|
||||
}
|
||||
|
||||
|
||||
@@ -307,7 +307,6 @@ public class ScriptListView extends SwipeRefreshLayout implements SwipeRefreshLa
|
||||
@Override
|
||||
public void onBindViewHolder(BindableViewHolder<?> holder, int position) {
|
||||
int positionOfCategoryFile = positionOfCategoryFile();
|
||||
Log.d(LOG_TAG, String.format("view holder = %s, pos = %d, posOfCategory = %d, size = %d", holder.getClass().toString(), position, positionOfCategoryFile, mScriptList.count()));
|
||||
BindableViewHolder bindableViewHolder = (BindableViewHolder) holder;
|
||||
if (position == positionOfCategoryDir || position == positionOfCategoryFile) {
|
||||
// FIXME: 2017/10/20 java.lang.ClassCastException: java.lang.Boolean cannot be cast to com.stardust.scriptdroid.model.script.ScriptFile
|
||||
@@ -323,17 +322,14 @@ public class ScriptListView extends SwipeRefreshLayout implements SwipeRefreshLa
|
||||
|
||||
@Override
|
||||
public int getItemViewType(int position) {
|
||||
int viewType;
|
||||
int positionOfCategoryFile = positionOfCategoryFile();
|
||||
if (position == positionOfCategoryDir || position == positionOfCategoryFile) {
|
||||
viewType = VIEW_TYPE_CATEGORY;
|
||||
return VIEW_TYPE_CATEGORY;
|
||||
} else if (position < positionOfCategoryFile) {
|
||||
viewType = VIEW_TYPE_DIRECTORY;
|
||||
return VIEW_TYPE_DIRECTORY;
|
||||
} else {
|
||||
viewType = VIEW_TYPE_FILE;
|
||||
return VIEW_TYPE_FILE;
|
||||
}
|
||||
Log.d(LOG_TAG, String.format("view type = %d, pos = %d, posOfCategory = %d, size = %d", viewType, position, positionOfCategoryFile, mScriptList.count()));
|
||||
return viewType;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user