[MediaWiki-commits] [Gerrit] Updated SquareUp libraries - change (apps...wikipedia)

2015-03-17 Thread Dbrant (Code Review)
Dbrant has submitted this change and it was merged.

Change subject: Updated SquareUp libraries
..


Updated SquareUp libraries

- Added missing credit for Picasso
- client.setCache does not throw IOException anymore

Highlights from https://github.com/square/picasso/blob/master/CHANGELOG.md:
* Memory and Network policy API controls reading and storing bitmaps in memory 
and/or disk cache.

TODO:
We may not need to use the OkUrlFactory shim in OkHttpConnectionFactory 
anymore, or even the whole class.
Updating acra would require code changes.

Change-Id: I44fd062e2d7c74c5b538146fa5a2fe637d2e9342
---
A wikipedia/assets/licenses/Picasso
M wikipedia/build.gradle
M wikipedia/res/values/credits.xml
M wikipedia/src/main/java/org/wikipedia/OkHttpConnectionFactory.java
4 files changed, 22 insertions(+), 11 deletions(-)

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



diff --git a/wikipedia/assets/licenses/Picasso 
b/wikipedia/assets/licenses/Picasso
new file mode 100644
index 000..25fdd59
--- /dev/null
+++ b/wikipedia/assets/licenses/Picasso
@@ -0,0 +1,13 @@
+Copyright 2013 Square, Inc.
+
+Licensed under the Apache License, Version 2.0 (the License);
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an AS IS BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
\ No newline at end of file
diff --git a/wikipedia/build.gradle b/wikipedia/build.gradle
index 858599c..6002aaf 100644
--- a/wikipedia/build.gradle
+++ b/wikipedia/build.gradle
@@ -98,10 +98,10 @@
 compile('org.mediawiki.api:json:1.3.0') {
 exclude group: 'org.json', module: 'json'
 }
-compile 'com.squareup.okhttp:okhttp-urlconnection:2.1.0'
-compile 'com.squareup.okhttp:okhttp:2.1.0'
-compile 'com.squareup:otto:1.3.5'
-compile 'com.squareup.picasso:picasso:2.4.0'
+compile 'com.squareup.okhttp:okhttp-urlconnection:2.3.0'
+compile 'com.squareup.okhttp:okhttp:2.3.0'
+compile 'com.squareup:otto:1.3.6'
+compile 'com.squareup.picasso:picasso:2.5.0'
 compile 'com.mobsandgeeks:android-saripaar:1.0.3'
 compile 'com.nineoldandroids:library:2.4.0'
 compile('ch.acra:acra:4.5.0') {
diff --git a/wikipedia/res/values/credits.xml b/wikipedia/res/values/credits.xml
index 15b75a5..bc747cd 100644
--- a/wikipedia/res/values/credits.xml
+++ b/wikipedia/res/values/credits.xml
@@ -29,6 +29,10 @@
 !-- end of https://github.com/chrisbanes/PhotoView --
 (a href=file:///android_asset/licenses/PhotoViewlicense/a),
 
+a href=https://square.github.io/picasso/;Picasso/a
+!-- end of http://square.github.io/picasso --
+(a href=file:///android_asset/licenses/Picassolicense/a),
+
 a 
href=https://github.com/ragunathjawahar/android-saripaar;Saripaar/a
 !-- end of 
https://github.com/ragunathjawahar/android-saripaar/blob/master/README.md --
 (a href=file:///android_asset/licenses/Saripaarlicense/a)
diff --git a/wikipedia/src/main/java/org/wikipedia/OkHttpConnectionFactory.java 
b/wikipedia/src/main/java/org/wikipedia/OkHttpConnectionFactory.java
index 245062d..6f432f7 100644
--- a/wikipedia/src/main/java/org/wikipedia/OkHttpConnectionFactory.java
+++ b/wikipedia/src/main/java/org/wikipedia/OkHttpConnectionFactory.java
@@ -19,13 +19,7 @@
 public OkHttpConnectionFactory(Context context) {
 client = new OkHttpClient();
 
client.setCookieHandler(((WikipediaApp)context.getApplicationContext()).getCookieManager());
-
-try {
-client.setCache(new Cache(context.getCacheDir(), HTTP_CACHE_SIZE));
-} catch (IOException e) {
-// Shouldn't happen...
-throw new RuntimeException(e);
-}
+client.setCache(new Cache(context.getCacheDir(), HTTP_CACHE_SIZE));
 }
 
 public HttpURLConnection create(URL url) throws IOException {

-- 
To view, visit https://gerrit.wikimedia.org/r/197376
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I44fd062e2d7c74c5b538146fa5a2fe637d2e9342
Gerrit-PatchSet: 1
Gerrit-Project: apps/android/wikipedia
Gerrit-Branch: master
Gerrit-Owner: BearND bsitzm...@wikimedia.org
Gerrit-Reviewer: Brion VIBBER br...@wikimedia.org
Gerrit-Reviewer: Dbrant dbr...@wikimedia.org
Gerrit-Reviewer: jenkins-bot 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Updated SquareUp libraries - change (apps...wikipedia)

2015-03-17 Thread BearND (Code Review)
BearND has uploaded a new change for review.

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

Change subject: Updated SquareUp libraries
..

Updated SquareUp libraries

- Added missing credit for Picasso
- client.setCache does not throw IOException anymore

Highlights from https://github.com/square/picasso/blob/master/CHANGELOG.md:
* Memory and Network policy API controls reading and storing bitmaps in memory 
and/or disk cache.

TODO:
We may not need to use the OkUrlFactory shim in OkHttpConnectionFactory 
anymore, or even the whole class.
Updating acra would require code changes.

Change-Id: I44fd062e2d7c74c5b538146fa5a2fe637d2e9342
---
A wikipedia/assets/licenses/Picasso
M wikipedia/build.gradle
M wikipedia/res/values/credits.xml
M wikipedia/src/main/java/org/wikipedia/OkHttpConnectionFactory.java
4 files changed, 22 insertions(+), 11 deletions(-)


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

diff --git a/wikipedia/assets/licenses/Picasso 
b/wikipedia/assets/licenses/Picasso
new file mode 100644
index 000..25fdd59
--- /dev/null
+++ b/wikipedia/assets/licenses/Picasso
@@ -0,0 +1,13 @@
+Copyright 2013 Square, Inc.
+
+Licensed under the Apache License, Version 2.0 (the License);
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an AS IS BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
\ No newline at end of file
diff --git a/wikipedia/build.gradle b/wikipedia/build.gradle
index 858599c..6002aaf 100644
--- a/wikipedia/build.gradle
+++ b/wikipedia/build.gradle
@@ -98,10 +98,10 @@
 compile('org.mediawiki.api:json:1.3.0') {
 exclude group: 'org.json', module: 'json'
 }
-compile 'com.squareup.okhttp:okhttp-urlconnection:2.1.0'
-compile 'com.squareup.okhttp:okhttp:2.1.0'
-compile 'com.squareup:otto:1.3.5'
-compile 'com.squareup.picasso:picasso:2.4.0'
+compile 'com.squareup.okhttp:okhttp-urlconnection:2.3.0'
+compile 'com.squareup.okhttp:okhttp:2.3.0'
+compile 'com.squareup:otto:1.3.6'
+compile 'com.squareup.picasso:picasso:2.5.0'
 compile 'com.mobsandgeeks:android-saripaar:1.0.3'
 compile 'com.nineoldandroids:library:2.4.0'
 compile('ch.acra:acra:4.5.0') {
diff --git a/wikipedia/res/values/credits.xml b/wikipedia/res/values/credits.xml
index 15b75a5..bc747cd 100644
--- a/wikipedia/res/values/credits.xml
+++ b/wikipedia/res/values/credits.xml
@@ -29,6 +29,10 @@
 !-- end of https://github.com/chrisbanes/PhotoView --
 (a href=file:///android_asset/licenses/PhotoViewlicense/a),
 
+a href=https://square.github.io/picasso/;Picasso/a
+!-- end of http://square.github.io/picasso --
+(a href=file:///android_asset/licenses/Picassolicense/a),
+
 a 
href=https://github.com/ragunathjawahar/android-saripaar;Saripaar/a
 !-- end of 
https://github.com/ragunathjawahar/android-saripaar/blob/master/README.md --
 (a href=file:///android_asset/licenses/Saripaarlicense/a)
diff --git a/wikipedia/src/main/java/org/wikipedia/OkHttpConnectionFactory.java 
b/wikipedia/src/main/java/org/wikipedia/OkHttpConnectionFactory.java
index 245062d..6f432f7 100644
--- a/wikipedia/src/main/java/org/wikipedia/OkHttpConnectionFactory.java
+++ b/wikipedia/src/main/java/org/wikipedia/OkHttpConnectionFactory.java
@@ -19,13 +19,7 @@
 public OkHttpConnectionFactory(Context context) {
 client = new OkHttpClient();
 
client.setCookieHandler(((WikipediaApp)context.getApplicationContext()).getCookieManager());
-
-try {
-client.setCache(new Cache(context.getCacheDir(), HTTP_CACHE_SIZE));
-} catch (IOException e) {
-// Shouldn't happen...
-throw new RuntimeException(e);
-}
+client.setCache(new Cache(context.getCacheDir(), HTTP_CACHE_SIZE));
 }
 
 public HttpURLConnection create(URL url) throws IOException {

-- 
To view, visit https://gerrit.wikimedia.org/r/197376
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I44fd062e2d7c74c5b538146fa5a2fe637d2e9342
Gerrit-PatchSet: 1
Gerrit-Project: apps/android/wikipedia
Gerrit-Branch: master
Gerrit-Owner: BearND bsitzm...@wikimedia.org

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Updated squareup libraries - change (apps...wikipedia)

2014-11-24 Thread BearND (Code Review)
BearND has uploaded a new change for review.

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

Change subject: Updated squareup libraries
..

Updated squareup libraries

The big change is in OkHttp from 1.3 to 2.1.
A few API changes regarding caches required code changes.
See https://github.com/square/okhttp/blob/master/CHANGELOG.md
for full list.

Also remove explicit entry for support-v4 since it's
transitively included through the appcompat-v7 dependency.
That way we don't accidentally have incompatible versions
of those two.

Change-Id: I0b2532276c72757e5941aef63cfc2f2dea8445ad
---
M wikipedia/build.gradle
M wikipedia/src/main/java/org/wikipedia/OkHttpConnectionFactory.java
2 files changed, 9 insertions(+), 12 deletions(-)


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

diff --git a/wikipedia/build.gradle b/wikipedia/build.gradle
index d6506f4..b4d44ae 100644
--- a/wikipedia/build.gradle
+++ b/wikipedia/build.gradle
@@ -97,21 +97,17 @@
 compile('org.mediawiki.api:json:1.3-SNAPSHOT') {
 exclude group: 'org.json', module: 'json'
 }
-compile 'com.squareup.okhttp:okhttp:1.3.0'
-//compile 'com.squareup.okhttp:okhttp:1.6.0'
-// maybe even 2.0.0
-compile 'com.squareup:otto:1.3.4'
-//compile 'com.squareup:otto:1.3.5'
-compile 'com.squareup.picasso:picasso:2.1.1'
-//compile 'com.squareup.picasso:picasso:2.3.2'
+compile 'com.squareup.okhttp:okhttp-urlconnection:2.1.0'
+compile 'com.squareup.okhttp:okhttp:2.1.0'
+compile 'com.squareup:otto:1.3.5'
+compile 'com.squareup.picasso:picasso:2.4.0'
 compile 'com.mobsandgeeks:android-saripaar:1.0.3'
 compile 'com.nineoldandroids:library:2.4.0'
 compile('ch.acra:acra:4.5.0') {
 exclude group: 'org.json', module: 'json'
 }
 compile 'de.keyboardsurfer.android.widget:crouton:1.8.5@aar'
-compile 'com.android.support:support-v4:21.0.2'
-compile 'com.android.support:appcompat-v7:21.0.2'
+compile 'com.android.support:appcompat-v7:21.0.2' // includes support-v4
 }
 
 // The next block is for setting the release signing config from a file 
outside the git repo
diff --git a/wikipedia/src/main/java/org/wikipedia/OkHttpConnectionFactory.java 
b/wikipedia/src/main/java/org/wikipedia/OkHttpConnectionFactory.java
index e7bfb04..245062d 100644
--- a/wikipedia/src/main/java/org/wikipedia/OkHttpConnectionFactory.java
+++ b/wikipedia/src/main/java/org/wikipedia/OkHttpConnectionFactory.java
@@ -2,8 +2,9 @@
 
 import android.content.Context;
 import com.github.kevinsawicki.http.HttpRequest;
-import com.squareup.okhttp.HttpResponseCache;
+import com.squareup.okhttp.Cache;
 import com.squareup.okhttp.OkHttpClient;
+import com.squareup.okhttp.OkUrlFactory;
 
 import java.io.IOException;
 import java.net.HttpURLConnection;
@@ -20,7 +21,7 @@
 
client.setCookieHandler(((WikipediaApp)context.getApplicationContext()).getCookieManager());
 
 try {
-client.setResponseCache(new 
HttpResponseCache(context.getCacheDir(), HTTP_CACHE_SIZE));
+client.setCache(new Cache(context.getCacheDir(), HTTP_CACHE_SIZE));
 } catch (IOException e) {
 // Shouldn't happen...
 throw new RuntimeException(e);
@@ -28,7 +29,7 @@
 }
 
 public HttpURLConnection create(URL url) throws IOException {
-return client.open(url);
+return new OkUrlFactory(client).open(url);
 }
 
 @Override

-- 
To view, visit https://gerrit.wikimedia.org/r/175588
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0b2532276c72757e5941aef63cfc2f2dea8445ad
Gerrit-PatchSet: 1
Gerrit-Project: apps/android/wikipedia
Gerrit-Branch: master
Gerrit-Owner: BearND bsitzm...@wikimedia.org

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Updated squareup libraries - change (apps...wikipedia)

2014-11-24 Thread Dbrant (Code Review)
Dbrant has submitted this change and it was merged.

Change subject: Updated squareup libraries
..


Updated squareup libraries

The big change is in OkHttp from 1.3 to 2.1.
A few API changes regarding caches required code changes.
See https://github.com/square/okhttp/blob/master/CHANGELOG.md
for full list.

Also remove explicit entry for support-v4 since it's
transitively included through the appcompat-v7 dependency.
That way we don't accidentally have incompatible versions
of those two.

Change-Id: I0b2532276c72757e5941aef63cfc2f2dea8445ad
---
M wikipedia/build.gradle
M wikipedia/src/main/java/org/wikipedia/OkHttpConnectionFactory.java
2 files changed, 9 insertions(+), 12 deletions(-)

Approvals:
  Dbrant: Looks good to me, approved



diff --git a/wikipedia/build.gradle b/wikipedia/build.gradle
index d6506f4..b4d44ae 100644
--- a/wikipedia/build.gradle
+++ b/wikipedia/build.gradle
@@ -97,21 +97,17 @@
 compile('org.mediawiki.api:json:1.3-SNAPSHOT') {
 exclude group: 'org.json', module: 'json'
 }
-compile 'com.squareup.okhttp:okhttp:1.3.0'
-//compile 'com.squareup.okhttp:okhttp:1.6.0'
-// maybe even 2.0.0
-compile 'com.squareup:otto:1.3.4'
-//compile 'com.squareup:otto:1.3.5'
-compile 'com.squareup.picasso:picasso:2.1.1'
-//compile 'com.squareup.picasso:picasso:2.3.2'
+compile 'com.squareup.okhttp:okhttp-urlconnection:2.1.0'
+compile 'com.squareup.okhttp:okhttp:2.1.0'
+compile 'com.squareup:otto:1.3.5'
+compile 'com.squareup.picasso:picasso:2.4.0'
 compile 'com.mobsandgeeks:android-saripaar:1.0.3'
 compile 'com.nineoldandroids:library:2.4.0'
 compile('ch.acra:acra:4.5.0') {
 exclude group: 'org.json', module: 'json'
 }
 compile 'de.keyboardsurfer.android.widget:crouton:1.8.5@aar'
-compile 'com.android.support:support-v4:21.0.2'
-compile 'com.android.support:appcompat-v7:21.0.2'
+compile 'com.android.support:appcompat-v7:21.0.2' // includes support-v4
 }
 
 // The next block is for setting the release signing config from a file 
outside the git repo
diff --git a/wikipedia/src/main/java/org/wikipedia/OkHttpConnectionFactory.java 
b/wikipedia/src/main/java/org/wikipedia/OkHttpConnectionFactory.java
index e7bfb04..245062d 100644
--- a/wikipedia/src/main/java/org/wikipedia/OkHttpConnectionFactory.java
+++ b/wikipedia/src/main/java/org/wikipedia/OkHttpConnectionFactory.java
@@ -2,8 +2,9 @@
 
 import android.content.Context;
 import com.github.kevinsawicki.http.HttpRequest;
-import com.squareup.okhttp.HttpResponseCache;
+import com.squareup.okhttp.Cache;
 import com.squareup.okhttp.OkHttpClient;
+import com.squareup.okhttp.OkUrlFactory;
 
 import java.io.IOException;
 import java.net.HttpURLConnection;
@@ -20,7 +21,7 @@
 
client.setCookieHandler(((WikipediaApp)context.getApplicationContext()).getCookieManager());
 
 try {
-client.setResponseCache(new 
HttpResponseCache(context.getCacheDir(), HTTP_CACHE_SIZE));
+client.setCache(new Cache(context.getCacheDir(), HTTP_CACHE_SIZE));
 } catch (IOException e) {
 // Shouldn't happen...
 throw new RuntimeException(e);
@@ -28,7 +29,7 @@
 }
 
 public HttpURLConnection create(URL url) throws IOException {
-return client.open(url);
+return new OkUrlFactory(client).open(url);
 }
 
 @Override

-- 
To view, visit https://gerrit.wikimedia.org/r/175588
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I0b2532276c72757e5941aef63cfc2f2dea8445ad
Gerrit-PatchSet: 1
Gerrit-Project: apps/android/wikipedia
Gerrit-Branch: master
Gerrit-Owner: BearND bsitzm...@wikimedia.org
Gerrit-Reviewer: Brion VIBBER br...@wikimedia.org
Gerrit-Reviewer: Dbrant dbr...@wikimedia.org
Gerrit-Reviewer: jenkins-bot 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits