package org.wikipedia.feed.image;

import android.net.Uri;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;

import org.wikipedia.R;
import org.wikipedia.Site;
import org.wikipedia.WikipediaApp;
import org.wikipedia.feed.model.UtcDate;
import org.wikipedia.feed.model.Card;
import org.wikipedia.util.DateUtil;

public class FeaturedImageCard extends Card {
    @NonNull private UtcDate date;
    @NonNull private Site site;
    @NonNull private FeaturedImage featuredImage;

    public FeaturedImageCard(@NonNull FeaturedImage featuredImage, @NonNull UtcDate date, @NonNull Site site) {
        this.featuredImage = featuredImage;
        this.site = site;
        this.date = date;
    }

    @NonNull
    public FeaturedImage baseImage() {
        return featuredImage;
    }

    @NonNull
    public UtcDate date() {
        return date;
    }

    @Override
    @NonNull
    public String title() {
        return WikipediaApp.getInstance().getString(R.string.view_featured_image_card_title);
    }

    @Override
    @NonNull
    public String subtitle() {
        return DateUtil.getFeedCardDateString(date.baseCalendar());
    }

    @NonNull
    public Site site() {
        return site;
    }

    @NonNull
    public String filename() {
        return featuredImage.title();
    }

    @Override
    @NonNull
    public Uri image() {
        return featuredImage.thumbnail().source();
    }

    @Nullable
    public String description() {
        return featuredImage.description();
    }

    //Expose the language of the returned description in case we want to hide it if it doesn't match
    //the request Site language
    @Nullable
    public String descriptionLang() {
        return featuredImage.descriptionLang();
    }

    @Override
    protected int dismissHashCode() {
        return featuredImage.title().hashCode();
    }
}

@@ -258,23 +258,20 @@
 d.model.
-UtcDate
+Card
 ;%0Aimport
@@ -288,36 +288,39 @@
 edia.feed.model.
-Card
+UtcDate
 ;%0Aimport org.wik
@@ -1536,248 +1536,8 @@
  %7D%0A%0A
-    //Expose the language of the returned description in case we want to hide it if it doesn't match%0A    //the request Site language%0A    @Nullable%0A    public String descriptionLang() %7B%0A        return featuredImage.descriptionLang();%0A    %7D%0A%0A
     

remove dead code in FeaturedImageCard