Removed npes from customApp

This commit is contained in:
s-ayush2903 2020-11-29 21:41:06 +05:30
parent eaf6b77664
commit 526b011162
No known key found for this signature in database
GPG Key ID: B4341DD08B2371CB

View File

@ -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)