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