enable webview zoom controls

bump version
This commit is contained in:
Andrew Dolgov 2013-05-31 19:44:35 +04:00
parent 4057f5ac69
commit 2c71f2e829
3 changed files with 235 additions and 243 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="181" android:versionCode="182"
android:versionName="1.8.1" > android:versionName="1.8.2" >
<uses-sdk <uses-sdk
android:minSdkVersion="8" android:minSdkVersion="8"

View File

@ -95,21 +95,7 @@ public class ArticleFragment extends Fragment implements GestureDetector.OnDoubl
m_article = savedInstanceState.getParcelable("article"); m_article = savedInstanceState.getParcelable("article");
} }
final View view = inflater.inflate(R.layout.article_fragment, container, false); View view = inflater.inflate(R.layout.article_fragment, container, false);
WebView content = (WebView) view.findViewById(R.id.content);
if (content != null) content.setVisibility(View.INVISIBLE);
// prevent flicker in ics
if (android.os.Build.VERSION.SDK_INT >= 11) {
content.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
}
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
if (isAdded()) {
if (m_article != null) { if (m_article != null) {
@ -181,6 +167,11 @@ public class ArticleFragment extends Fragment implements GestureDetector.OnDoubl
if (web != null) { if (web != null) {
registerForContextMenu(web); registerForContextMenu(web);
// prevent flicker in ics
if (android.os.Build.VERSION.SDK_INT >= 11) {
web.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
}
web.setWebChromeClient(new WebChromeClient() { web.setWebChromeClient(new WebChromeClient() {
@Override @Override
public void onProgressChanged(WebView view, int progress) { public void onProgressChanged(WebView view, int progress) {
@ -203,7 +194,10 @@ public class ArticleFragment extends Fragment implements GestureDetector.OnDoubl
WebSettings ws = web.getSettings(); WebSettings ws = web.getSettings();
ws.setSupportZoom(true); ws.setSupportZoom(true);
ws.setBuiltInZoomControls(false); ws.setBuiltInZoomControls(true);
if (!m_activity.isCompatMode())
ws.setDisplayZoomControls(false);
web.getSettings().setLayoutAlgorithm(LayoutAlgorithm.SINGLE_COLUMN); web.getSettings().setLayoutAlgorithm(LayoutAlgorithm.SINGLE_COLUMN);
@ -341,11 +335,6 @@ public class ArticleFragment extends Fragment implements GestureDetector.OnDoubl
} }
} }
}
}
}, 50);
return view; return view;
} }

View File

@ -175,7 +175,10 @@ public class OfflineArticleFragment extends Fragment implements GestureDetector.
WebSettings ws = web.getSettings(); WebSettings ws = web.getSettings();
ws.setSupportZoom(true); ws.setSupportZoom(true);
ws.setBuiltInZoomControls(false); ws.setBuiltInZoomControls(true);
if (!m_activity.isCompatMode())
ws.setDisplayZoomControls(false);
web.getSettings().setLayoutAlgorithm(LayoutAlgorithm.SINGLE_COLUMN); web.getSettings().setLayoutAlgorithm(LayoutAlgorithm.SINGLE_COLUMN);