|
|
@ -2,6 +2,7 @@ package io.legado.app.ui.rss.read |
|
|
|
|
|
|
|
|
|
|
|
import android.annotation.SuppressLint |
|
|
|
import android.annotation.SuppressLint |
|
|
|
import android.os.Bundle |
|
|
|
import android.os.Bundle |
|
|
|
|
|
|
|
import android.webkit.WebSettings |
|
|
|
import android.webkit.WebViewClient |
|
|
|
import android.webkit.WebViewClient |
|
|
|
import androidx.lifecycle.Observer |
|
|
|
import androidx.lifecycle.Observer |
|
|
|
import io.legado.app.R |
|
|
|
import io.legado.app.R |
|
|
@ -17,11 +18,16 @@ class ReadRssActivity : VMBaseActivity<ReadRssViewModel>(R.layout.activity_rss_r |
|
|
|
|
|
|
|
|
|
|
|
override fun onActivityCreated(savedInstanceState: Bundle?) { |
|
|
|
override fun onActivityCreated(savedInstanceState: Bundle?) { |
|
|
|
title = intent.getStringExtra("title") |
|
|
|
title = intent.getStringExtra("title") |
|
|
|
webView.webViewClient = WebViewClient() |
|
|
|
initWebView() |
|
|
|
initLiveData() |
|
|
|
initLiveData() |
|
|
|
viewModel.initData(intent) |
|
|
|
viewModel.initData(intent) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private fun initWebView() { |
|
|
|
|
|
|
|
webView.webViewClient = WebViewClient() |
|
|
|
|
|
|
|
webView.settings.mixedContentMode = WebSettings.MIXED_CONTENT_ALWAYS_ALLOW |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@SuppressLint("SetJavaScriptEnabled") |
|
|
|
@SuppressLint("SetJavaScriptEnabled") |
|
|
|
private fun initLiveData() { |
|
|
|
private fun initLiveData() { |
|
|
|
viewModel.rssSourceLiveData.observe(this, Observer { |
|
|
|
viewModel.rssSourceLiveData.observe(this, Observer { |
|
|
|