mirror of
https://github.com/TonyJiangWJ/Auto.js.git
synced 2026-06-21 21:01:43 +08:00
fix bugs
This commit is contained in:
parent
997b652df9
commit
dc468c7de4
@ -14,6 +14,7 @@ import java.util.List;
|
||||
* Created by Stardust on 2017/10/25.
|
||||
*/
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.N_MR1)
|
||||
public class ShortcutManager {
|
||||
|
||||
private static ShortcutManager sInstance;
|
||||
|
||||
@ -15,6 +15,7 @@ import org.autojs.autojs.autojs.AutoJs;
|
||||
import org.autojs.autojs.model.script.Scripts;
|
||||
import org.autojs.autojs.storage.file.StorageFileProvider;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.HashMap;
|
||||
|
||||
/**
|
||||
@ -98,7 +99,7 @@ public class DevPluginResponseHandler implements Handler {
|
||||
if (!name.endsWith(".js")) {
|
||||
name = name + ".js";
|
||||
}
|
||||
PFiles.write(StorageFileProvider.getDefaultDirectoryPath() + name, script);
|
||||
PFiles.write(new File(StorageFileProvider.getDefaultDirectoryPath(), name), script);
|
||||
GlobalAppContext.toast(R.string.text_script_save_successfully);
|
||||
}
|
||||
}
|
||||
|
||||
@ -35,6 +35,7 @@ public class DocsFragment extends ViewPagerFragment implements BackPressedHandle
|
||||
EWebView mEWebView;
|
||||
WebView mWebView;
|
||||
|
||||
private String mIndexUrl;
|
||||
private String mPreviousQuery;
|
||||
|
||||
|
||||
@ -52,14 +53,11 @@ public class DocsFragment extends ViewPagerFragment implements BackPressedHandle
|
||||
@AfterViews
|
||||
void setUpViews() {
|
||||
mWebView = mEWebView.getWebView();
|
||||
mEWebView.getSwipeRefreshLayout().setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
|
||||
@Override
|
||||
public void onRefresh() {
|
||||
if (TextUtils.equals(mWebView.getUrl(), mWebView.getOriginalUrl())) {
|
||||
loadUrl();
|
||||
} else {
|
||||
mEWebView.onRefresh();
|
||||
}
|
||||
mEWebView.getSwipeRefreshLayout().setOnRefreshListener(() -> {
|
||||
if (TextUtils.equals(mWebView.getUrl(), mIndexUrl)) {
|
||||
loadUrl();
|
||||
} else {
|
||||
mEWebView.onRefresh();
|
||||
}
|
||||
});
|
||||
Bundle savedWebViewState = getArguments().getBundle("savedWebViewState");
|
||||
@ -71,8 +69,8 @@ public class DocsFragment extends ViewPagerFragment implements BackPressedHandle
|
||||
}
|
||||
|
||||
private void loadUrl() {
|
||||
String url = Pref.getDocumentationUrl() + "index.html";
|
||||
mWebView.loadUrl(getArguments().getString(ARGUMENT_URL, url));
|
||||
mIndexUrl = getArguments().getString(ARGUMENT_URL, Pref.getDocumentationUrl() + "index.html");
|
||||
mWebView.loadUrl(mIndexUrl);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user