Integrate API for displaying featured images (#1456)

* Integrate API for displaying featured images

* Add pagination and refactor code so that it can be reused for category images

* Add license info to the images

* Fix author view

* Remove unused values

* Fix minor issues with featured images

* Fix null license url issue

* Remove some log lines

* Fix back navigation issue

* fix tests

* fix test inits

* Gracefully handling various error situations

* Added java docs
This commit is contained in:
Vivek Maskara 2018-05-07 13:39:23 +05:30 committed by neslihanturan
parent 96eae8c0a6
commit 9845a6265d
26 changed files with 953 additions and 309 deletions

View file

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
@ -16,20 +15,12 @@
android:layout_height="wrap_content" />
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/featuredFragmentContainer"
android:id="@+id/fragmentContainer"
android:orientation="horizontal"
android:layout_below="@id/toolbar">
<fragment
android:id="@+id/featuedListFragment"
android:name="fr.free.nrw.commons.featured.FeaturedImagesListFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:layout="@layout/fragment_contributions" />
</FrameLayout>
</RelativeLayout>

View file

@ -1,20 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?attr/mainBackground"
>
android:background="?attr/mainBackground">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/waiting_first_sync"
android:id="@+id/waitingMessage"
android:id="@+id/statusMessage"
android:layout_gravity="center"
android:visibility="gone"
tools:visibility="visible"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
/>
<ProgressBar
@ -22,11 +23,11 @@
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:visibility="gone"
android:id="@+id/loadingFeaturedImagesProgressBar"
android:id="@+id/loadingImagesProgressBar"
/>
<GridView
android:id="@+id/featuredImagesList"
android:id="@+id/categoryImagesList"
android:layout_height="match_parent"
android:layout_width="match_parent"
android:stretchMode="columnWidth"

View file

@ -9,7 +9,7 @@
>
<TextView
android:id="@+id/featuredImagesSequenceNumber"
android:id="@+id/categoryImagesSequenceNumber"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="98sp"
@ -19,7 +19,7 @@
/>
<fr.free.nrw.commons.MediaWikiImageView
android:id="@+id/featuredImageView"
android:id="@+id/categoryImageView"
android:layout_width="match_parent"
android:layout_height="240dp"
/>
@ -33,7 +33,7 @@
android:padding="@dimen/small_gap"
>
<ProgressBar
android:id="@+id/featuredProgress"
android:id="@+id/categoryProgress"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/ProgressBar"
@ -43,7 +43,7 @@
/>
<TextView
android:id="@+id/featuredImageTitle"
android:id="@+id/categoryImageTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#FFFFFFFF"
@ -53,7 +53,7 @@
/>
<TextView
android:id="@+id/featuredImageAuthor"
android:id="@+id/categoryImageAuthor"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#FFFFFFFF"

View file

@ -270,5 +270,9 @@
<string name="about_translate_proceed">Proceed</string>
<string name="about_translate_cancel">Cancel</string>
<string name="retry">Retry</string>
<string name="no_images_found">No images found!</string>
<string name="error_loading_images">Error occurred while loading images.</string>
<string name="image_uploaded_by">Uploaded by: %1$s</string>
<string name="share_app_title">Share App</string>
</resources>