mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 12:53:55 +01:00
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
55 lines
No EOL
1.9 KiB
XML
55 lines
No EOL
1.9 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
|
|
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
|
android:orientation="vertical"
|
|
android:layout_width="fill_parent"
|
|
android:layout_height="wrap_content"
|
|
android:padding="2dp"
|
|
android:paddingBottom="0dp"
|
|
>
|
|
|
|
<TextView android:id="@+id/contributionSequenceNumber"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:textSize="98sp"
|
|
android:textColor="#33FFFFFF"
|
|
android:typeface="serif"
|
|
android:layout_gravity="end|bottom"
|
|
/>
|
|
<org.wikimedia.commons.MediaWikiImageView android:id="@+id/contributionImage"
|
|
android:layout_width="fill_parent"
|
|
android:layout_height="240dp"
|
|
android:scaleType="centerCrop"
|
|
/>
|
|
|
|
<LinearLayout
|
|
android:layout_width="fill_parent"
|
|
android:layout_height="wrap_content"
|
|
android:layout_gravity="center|bottom"
|
|
android:background="#AA000000"
|
|
android:orientation="vertical"
|
|
android:padding="8dp"
|
|
>
|
|
|
|
<TextView
|
|
android:id="@+id/contributionState"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
style="?android:textAppearanceSmall"
|
|
android:textColor="#FFFFFFFF"
|
|
android:visibility="gone"
|
|
/>
|
|
|
|
<TextView
|
|
android:id="@+id/contributionTitle"
|
|
android:layout_width="wrap_content"
|
|
android:layout_height="wrap_content"
|
|
android:textColor="#FFFFFFFF"
|
|
style="?android:textAppearanceMedium"
|
|
android:maxLines="2"
|
|
android:ellipsize="end"
|
|
/>
|
|
|
|
</LinearLayout>
|
|
|
|
</FrameLayout> |