mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-09 23:40:26 -04:00
Removed npes from customApp
This commit is contained in:
parent
eaf6b77664
commit
526b011162
@ -743,13 +743,15 @@ public abstract class CoreReaderFragment extends BaseFragment
|
|||||||
private KiwixWebView initalizeWebView(String url) {
|
private KiwixWebView initalizeWebView(String url) {
|
||||||
AttributeSet attrs = StyleUtils.getAttributes(requireActivity(), R.xml.webview);
|
AttributeSet attrs = StyleUtils.getAttributes(requireActivity(), R.xml.webview);
|
||||||
KiwixWebView webView = createWebView(attrs);
|
KiwixWebView webView = createWebView(attrs);
|
||||||
loadUrl(url, webView);
|
if (webView != null) {
|
||||||
setUpWithTextToSpeech(webView);
|
loadUrl(url, webView);
|
||||||
documentParser.initInterface(webView);
|
setUpWithTextToSpeech(webView);
|
||||||
new ServiceWorkerUninitialiser(() -> {
|
documentParser.initInterface(webView);
|
||||||
openMainPage();
|
new ServiceWorkerUninitialiser(() -> {
|
||||||
return Unit.INSTANCE;
|
openMainPage();
|
||||||
}).initInterface(webView);
|
return Unit.INSTANCE;
|
||||||
|
}).initInterface(webView);
|
||||||
|
}
|
||||||
return webView;
|
return webView;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -780,11 +782,11 @@ public abstract class CoreReaderFragment extends BaseFragment
|
|||||||
private KiwixWebView newTab(String url, boolean selectTab) {
|
private KiwixWebView newTab(String url, boolean selectTab) {
|
||||||
KiwixWebView webView = initalizeWebView(url);
|
KiwixWebView webView = initalizeWebView(url);
|
||||||
webViewList.add(webView);
|
webViewList.add(webView);
|
||||||
if(selectTab) {
|
if (selectTab) {
|
||||||
selectTab(webViewList.size() - 1);
|
selectTab(webViewList.size() - 1);
|
||||||
}
|
}
|
||||||
tabsAdapter.notifyDataSetChanged();
|
tabsAdapter.notifyDataSetChanged();
|
||||||
setUpWebViewWithTextToSpeech();
|
//setUpWebViewWithTextToSpeech();
|
||||||
if (webView != null) {
|
if (webView != null) {
|
||||||
documentParser.initInterface(webView);
|
documentParser.initInterface(webView);
|
||||||
}
|
}
|
||||||
@ -1315,7 +1317,7 @@ public abstract class CoreReaderFragment extends BaseFragment
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void setUpWithTextToSpeech(KiwixWebView kiwixWebView) {
|
private void setUpWithTextToSpeech(KiwixWebView kiwixWebView) {
|
||||||
tts.initWebView(kiwixWebView);
|
if (kiwixWebView != null) tts.initWebView(kiwixWebView);
|
||||||
}
|
}
|
||||||
|
|
||||||
@OnClick(R2.id.activity_main_back_to_top_fab)
|
@OnClick(R2.id.activity_main_back_to_top_fab)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user