potential fix for the whitescreen issue

This commit is contained in:
Andrew Dolgov 2014-12-04 13:45:47 +03:00
parent 80f5751d9a
commit 810b88f652
4 changed files with 14 additions and 18 deletions

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.fox.ttrss" package="org.fox.ttrss"
android:versionCode="294" android:versionCode="295"
android:versionName="1.85" > android:versionName="1.86" >
<uses-sdk <uses-sdk
android:minSdkVersion="10" android:minSdkVersion="10"

View File

@ -19,6 +19,7 @@ import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.View.OnClickListener; import android.view.View.OnClickListener;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.webkit.WebBackForwardList;
import android.webkit.WebChromeClient; import android.webkit.WebChromeClient;
import android.webkit.WebSettings; import android.webkit.WebSettings;
import android.webkit.WebView; import android.webkit.WebView;
@ -318,7 +319,6 @@ public class ArticleFragment extends Fragment {
}); });
boolean acceleratedWebview = true; boolean acceleratedWebview = true;
boolean enableFullscreenVideo = m_prefs.getBoolean("enable_fs_video", false);
// prevent flicker in ics // prevent flicker in ics
if (!m_prefs.getBoolean("webview_hardware_accel", true) || useTitleWebView) { if (!m_prefs.getBoolean("webview_hardware_accel", true) || useTitleWebView) {
@ -377,10 +377,8 @@ public class ArticleFragment extends Fragment {
if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
ws.setJavaScriptEnabled(true); ws.setJavaScriptEnabled(true);
if (enableFullscreenVideo) { m_chromeClient = new FSVideoChromeClient(view);
m_chromeClient = new FSVideoChromeClient(view); m_web.setWebChromeClient(m_chromeClient);
m_web.setWebChromeClient(m_chromeClient);
}
} }
} }
@ -445,10 +443,16 @@ public class ArticleFragment extends Fragment {
// //
} }
if (savedInstanceState == null || !acceleratedWebview || !enableFullscreenVideo) if (savedInstanceState == null || !acceleratedWebview) {
m_web.loadDataWithBaseURL(baseUrl, content, "text/html", "utf-8", null); m_web.loadDataWithBaseURL(baseUrl, content, "text/html", "utf-8", null);
else } else {
m_web.restoreState(savedInstanceState); WebBackForwardList rc = m_web.restoreState(savedInstanceState);
if (rc == null) {
// restore failed...
m_web.loadDataWithBaseURL(baseUrl, content, "text/html", "utf-8", null);
}
}
} catch (RuntimeException e) { } catch (RuntimeException e) {
e.printStackTrace(); e.printStackTrace();

View File

@ -259,6 +259,4 @@
<string name="headline_display_mode_default">Default</string> <string name="headline_display_mode_default">Default</string>
<string name="headline_display_mode_no_images">No images</string> <string name="headline_display_mode_no_images">No images</string>
<string name="headline_display_mode_compact">Compact</string> <string name="headline_display_mode_compact">Compact</string>
<string name="prefs_enable_fs_video_summary">May cause graphical glitches on some devices.</string>
<string name="prefs_enable_fs_video">Fullscreen video support</string>
</resources> </resources>

View File

@ -143,12 +143,6 @@
android:key="use_volume_keys" android:key="use_volume_keys"
android:summary="@string/use_volume_keys_long" android:summary="@string/use_volume_keys_long"
android:title="@string/use_volume_keys" /> android:title="@string/use_volume_keys" />
<CheckBoxPreference
android:defaultValue="false"
android:key="enable_fs_video"
android:summary="@string/prefs_enable_fs_video_summary"
android:title="@string/prefs_enable_fs_video" />
<CheckBoxPreference <CheckBoxPreference
android:defaultValue="false" android:defaultValue="false"
android:key="full_screen_mode" android:key="full_screen_mode"