// Path: app/src/main/java/com/almoturg/sprog/data/MarkdownConverter.java
// public class MarkdownConverter {
//     private static Bypass bypass;
//     private static final Object bypassLock = new Object();
//     private Context context;
// 
//     public MarkdownConverter(Context context){
//         this.context = context;
//     }
// 
//     public CharSequence convertPoemMarkdown(String markdown, double timestamp) {
//         if (timestamp <  1360540800){ // = 2013-02-11
//             // Sprog's early poems had paragraph breaks at the end of each line.
//             // This regex replaces them with single linebreaks, except between stanzas.
//             // (Stanza breaks are detected by checking if the line above is italicized (enclosed in
//             // "*"s) while the one below is not, or vice versa. Some lines look like
//             // "*lorem ipsum*," (punctuation after the closing "*").
//             // There is a special case for one poem with "2." on a single line (c6juhtd).)
//             markdown = markdown.replaceAll(
//                     "(?:(?<=(?<!\n)\\*[.,]?)\\n\\n(?=\\*))|(?:(?<!(?:\\*[.,]?)|(?:2\\.))\\n\\n(?!\\*))",
//                     "  \n");
//         }
//         return convertMarkdown(markdown);
//     }
// 
//     public CharSequence convertMarkdown(String markdown) {
//         if (bypass == null) {
//             synchronized (bypassLock) {
//                 bypass = new Bypass(context);
//             }
//         }
// 
//         markdown = markdown.replaceAll("(?:^|[^(\\[])(https?://\\S*\\.\\S*)(?:\\s|$)", "[$1]($1)");
// 
//         CharSequence converted;
//         synchronized (bypassLock) {
//             converted = bypass.markdownToSpannable(markdown);
//         }
//         return converted;
//     }
// }
// 
// Path: app/src/main/java/com/almoturg/sprog/model/Poem.java
// public class Poem {
//     public int silver;
//     public int gold;
//     public int platinum;
//     public int score;
//     public String content;
//     public CharSequence first_line;
//     public double timestamp;
//     public long timestamp_long;
//     public String post_title;
//     public String post_author;
//     public String post_content;
//     public String post_url;
//     public List<ParentComment> parents;
//     public String link;
//     public Poem main_poem;
//     public boolean read;
//     public boolean favorite;
// 
//     public Poem(int silver, int gold, int platinum, int score, String content,
//                 CharSequence first_line, double timestamp,
//                 String post_title, String post_author, String post_content, String post_url,
//                 List<ParentComment> parents, String link, Poem main_poem,
//                 boolean is_read, boolean is_favorite) {
//         this.content = content;
//         this.silver = silver;
//         this.gold = gold;
//         this.platinum = platinum;
//         this.score = score;
//         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("/"));
//     }
// }
// 
// Path: app/src/main/java/com/almoturg/sprog/util/Util.java
// public static int getThemeColor(Context context, int attrId) {
//     final TypedValue value = new TypedValue();
//     context.getTheme().resolveAttribute(attrId, value, true);
//     return value.data;
// }
// 
// Path: app/src/main/java/com/almoturg/sprog/util/Util.java
// 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 android.content.Context;
import android.support.v4.content.res.ResourcesCompat;
import android.support.v7.widget.CardView;
import android.text.format.DateFormat;
import android.view.View;
import android.widget.TextView;
import com.almoturg.sprog.R;
import com.almoturg.sprog.data.MarkdownConverter;
import com.almoturg.sprog.model.Poem;
import java.util.Calendar;
import java.util.Locale;
import static com.almoturg.sprog.util.Util.getThemeColor;
import static com.almoturg.sprog.util.Util.isDarkTheme;
package com.almoturg.sprog.view;





public class PoemRow {
    private static Calendar cal;
    private static MarkdownConverter markdownConverter;

// Path: app/src/main/java/com/almoturg/sprog/data/MarkdownConverter.java
// public class MarkdownConverter {
//     private static Bypass bypass;
//     private static final Object bypassLock = new Object();
//     private Context context;
// 
//     public MarkdownConverter(Context context){
//         this.context = context;
//     }
// 
//     public CharSequence convertPoemMarkdown(String markdown, double timestamp) {
//         if (timestamp <  1360540800){ // = 2013-02-11
//             // Sprog's early poems had paragraph breaks at the end of each line.
//             // This regex replaces them with single linebreaks, except between stanzas.
//             // (Stanza breaks are detected by checking if the line above is italicized (enclosed in
//             // "*"s) while the one below is not, or vice versa. Some lines look like
//             // "*lorem ipsum*," (punctuation after the closing "*").
//             // There is a special case for one poem with "2." on a single line (c6juhtd).)
//             markdown = markdown.replaceAll(
//                     "(?:(?<=(?<!\n)\\*[.,]?)\\n\\n(?=\\*))|(?:(?<!(?:\\*[.,]?)|(?:2\\.))\\n\\n(?!\\*))",
//                     "  \n");
//         }
//         return convertMarkdown(markdown);
//     }
// 
//     public CharSequence convertMarkdown(String markdown) {
//         if (bypass == null) {
//             synchronized (bypassLock) {
//                 bypass = new Bypass(context);
//             }
//         }
// 
//         markdown = markdown.replaceAll("(?:^|[^(\\[])(https?://\\S*\\.\\S*)(?:\\s|$)", "[$1]($1)");
// 
//         CharSequence converted;
//         synchronized (bypassLock) {
//             converted = bypass.markdownToSpannable(markdown);
//         }
//         return converted;
//     }
// }
// 
// Path: app/src/main/java/com/almoturg/sprog/model/Poem.java
// public class Poem {
//     public int silver;
//     public int gold;
//     public int platinum;
//     public int score;
//     public String content;
//     public CharSequence first_line;
//     public double timestamp;
//     public long timestamp_long;
//     public String post_title;
//     public String post_author;
//     public String post_content;
//     public String post_url;
//     public List<ParentComment> parents;
//     public String link;
//     public Poem main_poem;
//     public boolean read;
//     public boolean favorite;
// 
//     public Poem(int silver, int gold, int platinum, int score, String content,
//                 CharSequence first_line, double timestamp,
//                 String post_title, String post_author, String post_content, String post_url,
//                 List<ParentComment> parents, String link, Poem main_poem,
//                 boolean is_read, boolean is_favorite) {
//         this.content = content;
//         this.silver = silver;
//         this.gold = gold;
//         this.platinum = platinum;
//         this.score = score;
//         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("/"));
//     }
// }
// 
// Path: app/src/main/java/com/almoturg/sprog/util/Util.java
// public static int getThemeColor(Context context, int attrId) {
//     final TypedValue value = new TypedValue();
//     context.getTheme().resolveAttribute(attrId, value, true);
//     return value.data;
// }
// 
// Path: app/src/main/java/com/almoturg/sprog/util/Util.java
// 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/view/PoemRow.java
import android.content.Context;
import android.support.v4.content.res.ResourcesCompat;
import android.support.v7.widget.CardView;
import android.text.format.DateFormat;
import android.view.View;
import android.widget.TextView;
import com.almoturg.sprog.R;
import com.almoturg.sprog.data.MarkdownConverter;
import com.almoturg.sprog.model.Poem;
import java.util.Calendar;
import java.util.Locale;
import static com.almoturg.sprog.util.Util.getThemeColor;
import static com.almoturg.sprog.util.Util.isDarkTheme;

package com.almoturg.sprog.view;





public class PoemRow {
    private static Calendar cal;
    private static MarkdownConverter markdownConverter;

    public static void update_poem_row_poem_page(Poem poem, View poem_row,