mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 04:43:54 +01:00
Volley images
Add support for using Volley to load remote images instead of UIL 1. Gives us Caching 2. Load images at full resolution, rather than hardcode them. This is done by trying to fetch an image at highest width possible for the particular view. If it 500s, we assume that the image is smaller than the requested width and just request the full size image 3. Created a MediaWikiImageView, to which you can pass a Media object and it will display it. Takes care of sizing, etc. Optionally you can also specify a view to use as the 'loading' view. TODO: Loading from content:// URIs still use UIL. Need to write a Volley HTTP Stack that can fake responses for content:// URIs. GitHub: https://github.com/wikimedia/apps-android-commons/pull/1 Change-Id: Ia21a7b19fefa552d5a0b013085d0f5f1f80dc5ff
This commit is contained in:
parent
a28fc9a6ff
commit
57888260ec
8 changed files with 298 additions and 37 deletions
|
|
@ -22,11 +22,10 @@
|
|||
android:visibility="gone"
|
||||
/>
|
||||
|
||||
<ImageView android:id="@+id/mediaDetailImage"
|
||||
<org.wikimedia.commons.MediaWikiImageView android:id="@+id/mediaDetailImage"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:scaleType="fitCenter"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
|
||||
<RelativeLayout
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
android:typeface="serif"
|
||||
android:layout_gravity="end|bottom"
|
||||
/>
|
||||
<ImageView android:id="@+id/contributionImage"
|
||||
<org.wikimedia.commons.MediaWikiImageView android:id="@+id/contributionImage"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="240dp"
|
||||
android:scaleType="centerCrop"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue