// Path: app/src/main/java/com/almoturg/sprog/util/Util.java
// public final class Util {
//     public static <T> T last(T[] array) {
//         return array[array.length - 1];
//     }
// 
//     @SuppressWarnings("deprecation")
//     public static Spanned fromHtml(String source) {
//         // This converts html to Spanned.
//         // fromHtml(String) is deprecated in Nougat so we need to check the version.
//         if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
//             return Html.fromHtml(source, Html.FROM_HTML_MODE_LEGACY);
//         } else {
//             return Html.fromHtml(source);
//         }
//     }
// 
//     public static int getDisplayWidthDp(Context context) {
//         Configuration configuration = context.getResources().getConfiguration();
//         return configuration.screenWidthDp;
//     }
// 
//     public static Spanned linkToSpan(String link) {
//         return fromHtml(String.format("<a href=\"%s\">%s</a>", link, link));
//     }
// 
//     public static int getThemeColor(Context context, int attrId) {
//         final TypedValue value = new TypedValue();
//         context.getTheme().resolveAttribute(attrId, value, true);
//         return value.data;
//     }
// 
//     public static int getThemeReference(Context context, int attrId) {
//         final TypedValue value = new TypedValue();
//         context.getTheme().resolveAttribute(attrId, value, false);
//         return value.data;
//     }
// 
//     public static boolean isDarkTheme(Context context) {
//         final TypedValue value = new TypedValue();
//         context.getTheme().resolveAttribute(R.attr.themeName, value, true);
//         return value.string.equals("dark");
//     }
// }


import com.almoturg.sprog.util.Util;
import java.util.List;
        this.timestamp = timestamp;
        this.timestamp_long = (long) timestamp * 1000;
        this.post_title = post_title;
        this.post_author = post_author;
        this.post_content = post_content;
        this.post_url = post_url;
        this.parents = parents;
        this.link = link;
        this.main_poem = main_poem;

        this.first_line = first_line;
        this.read = is_read;
        this.favorite = is_favorite;
    }

    public void toggleFavorite(SprogDbHelper db){
        this.favorite = !this.favorite;
        if (this.favorite) {
            db.addFavoritePoem(this.link);
        } else {
            db.removeFavoritePoem(this.link);
        }

    }

    public int totalAwards(){
        return 3 * this.platinum + 2 * this.gold + this.silver;
    }

    public String getId() {
// Path: app/src/main/java/com/almoturg/sprog/util/Util.java
// public final class Util {
//     public static <T> T last(T[] array) {
//         return array[array.length - 1];
//     }
// 
//     @SuppressWarnings("deprecation")
//     public static Spanned fromHtml(String source) {
//         // This converts html to Spanned.
//         // fromHtml(String) is deprecated in Nougat so we need to check the version.
//         if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
//             return Html.fromHtml(source, Html.FROM_HTML_MODE_LEGACY);
//         } else {
//             return Html.fromHtml(source);
//         }
//     }
// 
//     public static int getDisplayWidthDp(Context context) {
//         Configuration configuration = context.getResources().getConfiguration();
//         return configuration.screenWidthDp;
//     }
// 
//     public static Spanned linkToSpan(String link) {
//         return fromHtml(String.format("<a href=\"%s\">%s</a>", link, link));
//     }
// 
//     public static int getThemeColor(Context context, int attrId) {
//         final TypedValue value = new TypedValue();
//         context.getTheme().resolveAttribute(attrId, value, true);
//         return value.data;
//     }
// 
//     public static int getThemeReference(Context context, int attrId) {
//         final TypedValue value = new TypedValue();
//         context.getTheme().resolveAttribute(attrId, value, false);
//         return value.data;
//     }
// 
//     public static boolean isDarkTheme(Context context) {
//         final TypedValue value = new TypedValue();
//         context.getTheme().resolveAttribute(R.attr.themeName, value, true);
//         return value.string.equals("dark");
//     }
// }


// Path: app/src/main/java/com/almoturg/sprog/model/Poem.java
import com.almoturg.sprog.util.Util;
import java.util.List;

        this.timestamp = timestamp;
        this.timestamp_long = (long) timestamp * 1000;
        this.post_title = post_title;
        this.post_author = post_author;
        this.post_content = post_content;
        this.post_url = post_url;
        this.parents = parents;
        this.link = link;
        this.main_poem = main_poem;

        this.first_line = first_line;
        this.read = is_read;
        this.favorite = is_favorite;
    }

    public void toggleFavorite(SprogDbHelper db){
        this.favorite = !this.favorite;
        if (this.favorite) {
            db.addFavoritePoem(this.link);
        } else {
            db.removeFavoritePoem(this.link);
        }

    }

    public int totalAwards(){
        return 3 * this.platinum + 2 * this.gold + this.silver;
    }

    public String getId() {
        return Util.last(this.link.split("/"));