[MediaWiki-commits] [Gerrit] Hygiene: remove HtmlPageLoadStrategy - change (apps...wikipedia)

2015-11-06 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Hygiene: remove HtmlPageLoadStrategy
..


Hygiene: remove HtmlPageLoadStrategy

Remove HtmlPageLoadStrategy since it's no longer supported by Content
Service.

Change-Id: I58b1fa0a87747c029cba2ecd0ac1f73de31517c5
---
D app/src/main/java/org/wikipedia/page/HtmlPageLoadStrategy.java
M app/src/main/java/org/wikipedia/page/PageFragment.java
M app/src/main/java/org/wikipedia/settings/Prefs.java
M app/src/main/res/values/preference_keys.xml
M app/src/main/res/xml/developer_preferences.xml
5 files changed, 2 insertions(+), 279 deletions(-)

Approvals:
  Dbrant: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/app/src/main/java/org/wikipedia/page/HtmlPageLoadStrategy.java 
b/app/src/main/java/org/wikipedia/page/HtmlPageLoadStrategy.java
deleted file mode 100644
index c5e3cb5..000
--- a/app/src/main/java/org/wikipedia/page/HtmlPageLoadStrategy.java
+++ /dev/null
@@ -1,262 +0,0 @@
-package org.wikipedia.page;
-
-import org.wikipedia.bridge.CommunicationBridge;
-import org.wikipedia.editing.EditHandler;
-import org.wikipedia.page.leadimages.LeadImagesHandler;
-import org.wikipedia.search.SearchBarHideHandler;
-import org.wikipedia.views.ObservableWebView;
-import org.wikipedia.views.SwipeRefreshLayoutWithScroll;
-
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import android.content.Intent;
-import android.graphics.Bitmap;
-import android.net.http.SslError;
-import android.support.annotation.NonNull;
-import android.webkit.SslErrorHandler;
-import android.webkit.WebResourceRequest;
-import android.webkit.WebResourceResponse;
-import android.webkit.WebView;
-import android.webkit.WebViewClient;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Our new page load strategy, which loads the page via webView#loadUrl.
- * The CSS is also provided by the service.
- * 
- * The experimental service is available on labs under:
- * 
https://appservice.wmflabs.org/en.m.wikipedia.org/v1/mobile/app/page/html/:title
- * Or you can switch to your local installation by using something similar to 
the
- * commented out SERVICE_URI_START value.
- * 
- * There is still plenty of work to be done to make this look and behave nicer:
- * TODO: add more JS (probably in the service)
- * (^ I hope this would also improve CSS, and allow us to bring back night 
mode and editing)
- * TODO: enwiki hard-coded. Use correct site/domain
- * TODO: bottom content (Read more/next, attributions)
- * TODO: lead image
- * TODO: save pages/load save pages
- * TODO: cache pages/load from cache??? (Maybe we can skip that by just using 
the web cache)
- * TODO: ... and probably more ...
- */
-public class HtmlPageLoadStrategy implements PageLoadStrategy {
-// to hit the service on local deployment; update the hostname for your 
needs
-//private static final String SERVICE_URI_START = "http://besiair:6927/;;
-private static final String SERVICE_URI_START = 
"https://appservice.wmflabs.org/;;
-private static final String SERVICE_URI
-= SERVICE_URI_START + 
"en.m.wikipedia.org/v1/mobile/app/page/html/";
-private static final String WIKI = SERVICE_URI_START + "wiki/";
-
-// Note: several commented out variables/statements are carried over from 
the JsonPageLoadStrategy.
-
-/**
- * Whether to write the page contents to cache as soon as it's loaded.
- */
-//private boolean cacheOnComplete = true;
-
-//private int sectionTargetFromIntent;
-
-// copied fields
-private PageViewModel model;
-private PageFragment fragment;
-private CommunicationBridge bridge;
-private PageActivity activity;
-private ObservableWebView webView;
-private SwipeRefreshLayoutWithScroll refreshView;
-//private WikipediaApp app;
-//private LeadImagesHandler leadImagesHandler;
-//private SearchBarHideHandler searchBarHideHandler;
-
-//private BottomContentInterface bottomContentHandler;
-
-private boolean isLoading;
-
-@Override
-public void setup(PageViewModel model, PageFragment fragment,
-  SwipeRefreshLayoutWithScroll refreshView, 
ObservableWebView webView,
-  CommunicationBridge bridge, SearchBarHideHandler 
searchBarHideHandler,
-  LeadImagesHandler leadImagesHandler) {
-this.model = model;
-this.fragment = fragment;
-activity = (PageActivity) fragment.getActivity();
-//this.app = (WikipediaApp) activity.getApplicationContext();
-this.refreshView = refreshView;
-this.webView = webView;
-this.bridge = bridge;
-//this.searchBarHideHandler = searchBarHideHandler;
-//this.leadImagesHandler = leadImagesHandler;
-}
-
-@Override
-public void onActivityCreated(@NonNull List backStack) {
-setupSpecificMessageHandlers();

[MediaWiki-commits] [Gerrit] Hygiene: remove HtmlPageLoadStrategy - change (apps...wikipedia)

2015-11-05 Thread Niedzielski (Code Review)
Niedzielski has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/251408

Change subject: Hygiene: remove HtmlPageLoadStrategy
..

Hygiene: remove HtmlPageLoadStrategy

Remove HtmlPageLoadStrategy since it's no longer supported by Content
Service.

Change-Id: I58b1fa0a87747c029cba2ecd0ac1f73de31517c5
---
D app/src/main/java/org/wikipedia/page/HtmlPageLoadStrategy.java
M app/src/main/java/org/wikipedia/page/PageFragment.java
M app/src/main/java/org/wikipedia/settings/Prefs.java
M app/src/main/res/xml/developer_preferences.xml
4 files changed, 2 insertions(+), 278 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia 
refs/changes/08/251408/1

diff --git a/app/src/main/java/org/wikipedia/page/HtmlPageLoadStrategy.java 
b/app/src/main/java/org/wikipedia/page/HtmlPageLoadStrategy.java
deleted file mode 100644
index c5e3cb5..000
--- a/app/src/main/java/org/wikipedia/page/HtmlPageLoadStrategy.java
+++ /dev/null
@@ -1,262 +0,0 @@
-package org.wikipedia.page;
-
-import org.wikipedia.bridge.CommunicationBridge;
-import org.wikipedia.editing.EditHandler;
-import org.wikipedia.page.leadimages.LeadImagesHandler;
-import org.wikipedia.search.SearchBarHideHandler;
-import org.wikipedia.views.ObservableWebView;
-import org.wikipedia.views.SwipeRefreshLayoutWithScroll;
-
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
-
-import android.content.Intent;
-import android.graphics.Bitmap;
-import android.net.http.SslError;
-import android.support.annotation.NonNull;
-import android.webkit.SslErrorHandler;
-import android.webkit.WebResourceRequest;
-import android.webkit.WebResourceResponse;
-import android.webkit.WebView;
-import android.webkit.WebViewClient;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Our new page load strategy, which loads the page via webView#loadUrl.
- * The CSS is also provided by the service.
- * 
- * The experimental service is available on labs under:
- * 
https://appservice.wmflabs.org/en.m.wikipedia.org/v1/mobile/app/page/html/:title
- * Or you can switch to your local installation by using something similar to 
the
- * commented out SERVICE_URI_START value.
- * 
- * There is still plenty of work to be done to make this look and behave nicer:
- * TODO: add more JS (probably in the service)
- * (^ I hope this would also improve CSS, and allow us to bring back night 
mode and editing)
- * TODO: enwiki hard-coded. Use correct site/domain
- * TODO: bottom content (Read more/next, attributions)
- * TODO: lead image
- * TODO: save pages/load save pages
- * TODO: cache pages/load from cache??? (Maybe we can skip that by just using 
the web cache)
- * TODO: ... and probably more ...
- */
-public class HtmlPageLoadStrategy implements PageLoadStrategy {
-// to hit the service on local deployment; update the hostname for your 
needs
-//private static final String SERVICE_URI_START = "http://besiair:6927/;;
-private static final String SERVICE_URI_START = 
"https://appservice.wmflabs.org/;;
-private static final String SERVICE_URI
-= SERVICE_URI_START + 
"en.m.wikipedia.org/v1/mobile/app/page/html/";
-private static final String WIKI = SERVICE_URI_START + "wiki/";
-
-// Note: several commented out variables/statements are carried over from 
the JsonPageLoadStrategy.
-
-/**
- * Whether to write the page contents to cache as soon as it's loaded.
- */
-//private boolean cacheOnComplete = true;
-
-//private int sectionTargetFromIntent;
-
-// copied fields
-private PageViewModel model;
-private PageFragment fragment;
-private CommunicationBridge bridge;
-private PageActivity activity;
-private ObservableWebView webView;
-private SwipeRefreshLayoutWithScroll refreshView;
-//private WikipediaApp app;
-//private LeadImagesHandler leadImagesHandler;
-//private SearchBarHideHandler searchBarHideHandler;
-
-//private BottomContentInterface bottomContentHandler;
-
-private boolean isLoading;
-
-@Override
-public void setup(PageViewModel model, PageFragment fragment,
-  SwipeRefreshLayoutWithScroll refreshView, 
ObservableWebView webView,
-  CommunicationBridge bridge, SearchBarHideHandler 
searchBarHideHandler,
-  LeadImagesHandler leadImagesHandler) {
-this.model = model;
-this.fragment = fragment;
-activity = (PageActivity) fragment.getActivity();
-//this.app = (WikipediaApp) activity.getApplicationContext();
-this.refreshView = refreshView;
-this.webView = webView;
-this.bridge = bridge;
-//this.searchBarHideHandler = searchBarHideHandler;
-//this.leadImagesHandler = leadImagesHandler;
-}
-
-@Override
-public void onActivityCreated(@NonNull List backStack) {
-