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,6 +743,7 @@ 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);
|
||||||
|
if (webView != null) {
|
||||||
loadUrl(url, webView);
|
loadUrl(url, webView);
|
||||||
setUpWithTextToSpeech(webView);
|
setUpWithTextToSpeech(webView);
|
||||||
documentParser.initInterface(webView);
|
documentParser.initInterface(webView);
|
||||||
@ -750,6 +751,7 @@ public abstract class CoreReaderFragment extends BaseFragment
|
|||||||
openMainPage();
|
openMainPage();
|
||||||
return Unit.INSTANCE;
|
return Unit.INSTANCE;
|
||||||
}).initInterface(webView);
|
}).initInterface(webView);
|
||||||
|
}
|
||||||
return webView;
|
return webView;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -784,7 +786,7 @@ public abstract class CoreReaderFragment extends BaseFragment
|
|||||||
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