Browse Source

Code cleanup and yt embedding fixes

pull/24/head
Apostolos Fanakis 8 years ago
parent
commit
ecf6363c74
  1. 7
      app/src/main/assets/style.css
  2. 8
      app/src/main/java/gr/thmmy/mthmmy/activities/topic/TopicActivity.java
  3. 431
      app/src/main/java/gr/thmmy/mthmmy/activities/topic/TopicParser.java

7
app/src/main/assets/style.css

@ -843,4 +843,11 @@ img
{ {
max-width:100% !important; max-width:100% !important;
height:auto !important; height:auto !important;
}
.embedded-video-play{
display: block;
width: 5%;
opacity: 0.7;
z-index: 2;
} }

8
app/src/main/java/gr/thmmy/mthmmy/activities/topic/TopicActivity.java

@ -406,6 +406,8 @@ public class TopicActivity extends BaseActivity {
/* Parse method */ /* Parse method */
private void parse(Document document) { private void parse(Document document) {
String language = TopicParser.defineLanguage(document);
//Find topic title if missing //Find topic title if missing
if (topicTitle == null || Objects.equals(topicTitle, "")) { if (topicTitle == null || Objects.equals(topicTitle, "")) {
parsedTitle = document.select("td[id=top_subject]").first().text(); parsedTitle = document.select("td[id=top_subject]").first().text();
@ -420,10 +422,10 @@ public class TopicActivity extends BaseActivity {
} }
{ //Find current page's index { //Find current page's index
thisPage = TopicParser.parseCurrentPageIndex(document); thisPage = TopicParser.parseCurrentPageIndex(document, language);
} }
{ //Find number of pages { //Find number of pages
numberOfPages = TopicParser.parseTopicNumberOfPages(document, thisPage); numberOfPages = TopicParser.parseTopicNumberOfPages(document, thisPage, language);
for (int i = 0; i < numberOfPages; i++) { for (int i = 0; i < numberOfPages; i++) {
//Generate each page's url from topic's base url +".15*numberOfPage" //Generate each page's url from topic's base url +".15*numberOfPage"
@ -431,7 +433,7 @@ public class TopicActivity extends BaseActivity {
} }
} }
postsList = TopicParser.parseTopic(document); postsList = TopicParser.parseTopic(document, language);
} }
/* Parse method end */ /* Parse method end */
} }

431
app/src/main/java/gr/thmmy/mthmmy/activities/topic/TopicParser.java

@ -1,7 +1,6 @@
package gr.thmmy.mthmmy.activities.topic; package gr.thmmy.mthmmy.activities.topic;
import android.graphics.Color; import android.graphics.Color;
import android.util.Log;
import org.jsoup.Jsoup; import org.jsoup.Jsoup;
import org.jsoup.nodes.Document; import org.jsoup.nodes.Document;
@ -16,21 +15,9 @@ import java.util.Objects;
import gr.thmmy.mthmmy.data.Post; import gr.thmmy.mthmmy.data.Post;
class TopicParser { class TopicParser {
//Parsing variables //Languages supported
private static String usersViewingTopic; private static final String LANGUAGE_GREEK = "Greek";
private static String currentPage; private static final String LANGUAGE_ENGLISH = "English";
private static String postRowSelection;
private static String userNameSelection;
private static String guestSelection;
private static int postDateSubstrSelection;
private static String postNumberSelection;
private static int postNumSubstrSelection;
private static String postAttachedDiv;
private static String postAttachedSubstr;
private static String numberOfPostsSelection;
private static String genderSelection;
private static String genderAltMale;
private static String genderAltFemale;
//User colors variables //User colors variables
private static final int USER_COLOR_BLACK = Color.parseColor("#000000"); private static final int USER_COLOR_BLACK = Color.parseColor("#000000");
@ -43,57 +30,82 @@ class TopicParser {
@SuppressWarnings("unused") @SuppressWarnings("unused")
private static final String TAG = "TopicParser"; private static final String TAG = "TopicParser";
static String parseUsersViewingThisTopic(Document doc){ static String parseUsersViewingThisTopic(Document doc, String language) {
defineLanguage(doc); if (Objects.equals(language, LANGUAGE_GREEK))
Log.d(TAG, doc.select("td:containsOwn(" + usersViewingTopic + ")").first().text()); return doc.select("td:containsOwn(διαβάζουν αυτό το θέμα)").first().html();
return doc.select("td:containsOwn(" + usersViewingTopic + ")").first().html(); return doc.select("td:containsOwn(are viewing this topic)").first().html();
} }
static int parseCurrentPageIndex(Document doc) { static int parseCurrentPageIndex(Document doc, String language) {
defineLanguage(doc);
int returnPage = 1; int returnPage = 1;
//Contains pages
Elements findCurrentPage = doc.select("td:contains(" + currentPage + ")>b"); if (Objects.equals(language, LANGUAGE_GREEK)) {
//Contains pages
for (Element item : findCurrentPage) { Elements findCurrentPage = doc.select("td:contains(Σελίδες:)>b");
if (!item.text().contains("...") //It's not "..."
&& !item.text().contains(currentPage)) { //Nor "Pages:"/"Σελίδες:" for (Element item : findCurrentPage) {
returnPage = Integer.parseInt(item.text()); if (!item.text().contains("...") //It's not "..."
break; && !item.text().contains("Σελίδες:")) { //Nor "Σελίδες:"
returnPage = Integer.parseInt(item.text());
break;
}
}
} else {
Elements findCurrentPage = doc.select("td:contains(Pages:)>b");
for (Element item : findCurrentPage) {
if (!item.text().contains("...") && !item.text().contains("Pages:")) {
returnPage = Integer.parseInt(item.text());
break;
}
} }
} }
return returnPage; return returnPage;
} }
static int parseTopicNumberOfPages(Document doc, int thisPage) { static int parseTopicNumberOfPages(Document doc, int thisPage, String language) {
defineLanguage(doc);
//Method's variables //Method's variables
int returnPages = 1; int returnPages = 1;
//Contains all pages if (Objects.equals(language, LANGUAGE_GREEK)) {
Elements pages = doc.select("td:contains(" + currentPage + ")>a.navPages"); //Contains all pages
Elements pages = doc.select("td:contains(Σελίδες:)>a.navPages");
if (pages.size() != 0) { if (pages.size() != 0) {
returnPages = thisPage; //Initialize the number returnPages = thisPage; //Initialize the number
for (Element item : pages) { //Just a max for (Element item : pages) { //Just a max
if (Integer.parseInt(item.text()) > returnPages) if (Integer.parseInt(item.text()) > returnPages)
returnPages = Integer.parseInt(item.text()); returnPages = Integer.parseInt(item.text());
}
}
} else {
//Contains all pages
Elements pages = doc.select("td:contains(Pages:)>a.navPages");
if (pages.size() != 0) {
returnPages = thisPage;
for (Element item : pages) {
if (Integer.parseInt(item.text()) > returnPages)
returnPages = Integer.parseInt(item.text());
}
} }
} }
return returnPages; return returnPages;
} }
static ArrayList<Post> parseTopic(Document doc) { static ArrayList<Post> parseTopic(Document doc, String language) {
defineLanguage(doc);
//Method's variables //Method's variables
final int NO_INDEX = -1; final int NO_INDEX = -1;
ArrayList<Post> returnList = new ArrayList<>(); ArrayList<Post> returnList = new ArrayList<>();
Elements rows;
Elements rows = doc.select("form[id=quickModForm]>table>tbody>tr:matches(" if (Objects.equals(language, LANGUAGE_GREEK))
+ postRowSelection +")"); rows = doc.select("form[id=quickModForm]>table>tbody>tr:matches(στις)");
else {
rows = doc.select("form[id=quickModForm]>table>tbody>tr:matches(on)");
}
for (Element item : rows) { //For every post for (Element item : rows) { //For every post
//Variables to pass //Variables to pass
@ -114,21 +126,7 @@ class TopicParser {
p_userColor = USER_COLOR_YELLOW; p_userColor = USER_COLOR_YELLOW;
p_attachedFiles = new ArrayList<>(); p_attachedFiles = new ArrayList<>();
//Find the Username //Language independent parsing
Element userName = item.select("a[title^=" + userNameSelection + "]").first();
if (userName == null) { //Deleted profile
p_isDeleted = true;
p_userName = item
.select("td:has(div.smalltext:containsOwn("
+ guestSelection + "))[style^=overflow]")
.first().text();
p_userName = p_userName.substring(0, p_userName.indexOf(" " + guestSelection));
p_userColor = USER_COLOR_BLACK;
} else {
p_userName = userName.html();
p_profileURL = userName.attr("href");
}
//Find thumbnail url //Find thumbnail url
Element thumbnailUrl = item.select("img.avatar").first(); Element thumbnailUrl = item.select("img.avatar").first();
p_thumbnailUrl = null; //In case user doesn't have an avatar p_thumbnailUrl = null; //In case user doesn't have an avatar
@ -142,7 +140,7 @@ class TopicParser {
//Find post's text //Find post's text
p_post = item.select("div").select(".post").first().outerHtml(); p_post = item.select("div").select(".post").first().outerHtml();
{ { //Fix embedded videos
Elements noembedTag = item.select("div").select(".post").first().select("noembed"); Elements noembedTag = item.select("div").select(".post").first().select("noembed");
ArrayList<String> embededVideosUrls = new ArrayList<>(); ArrayList<String> embededVideosUrls = new ArrayList<>();
@ -158,32 +156,20 @@ class TopicParser {
break; break;
p_post = p_post.replace( p_post = p_post.replace(
p_post.substring(p_post.indexOf("<embed"), p_post.indexOf("/noembed>") + 9) p_post.substring(p_post.indexOf("<embed"), p_post.indexOf("/noembed>") + 9)
, "<iframe width=\"100%\" height=\"auto\" src=\"" , "<div class=\"embedded-video\">"
+ "https://www.youtube.com/embed/" + "<a href=\"https://www.youtube.com/"
+ embededVideosUrls.get(tmp_counter) + embededVideosUrls.get(tmp_counter) + "\" target=\"_blank\">"
+ "\" frameborder=\"0\" allowfullscreen></iframe>" + "<img src=\"https://img.youtube.com/vi/"
); + embededVideosUrls.get(tmp_counter) + "/default.jpg\" alt=\"\" border=\"0\">"
+ "</a>"
//+ "<img class=\"embedded-video-play\" src=\"http://www.youtube.com/yt/brand/media/image/YouTube_light_color_icon.png\">"
+ "</div>");
} }
} }
//Add stuff to make it work in WebView //Add stuff to make it work in WebView
p_post = ("<link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\" />" //style.css
+ p_post); //style.css p_post = ("<link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\" />" + p_post);
//Find post's submit date
Element postDate = item.select("div.smalltext:matches(" + postRowSelection + ":)").first();
p_postDate = postDate.text();
p_postDate = p_postDate.substring(p_postDate.indexOf(postRowSelection + ":") + postDateSubstrSelection
, p_postDate.indexOf(" »"));
//Find post's number
Element postNum = item.select("div.smalltext:matches(" + postNumberSelection + ")").first();
if (postNum == null) { //Topic starter
p_postNum = 0;
} else {
String tmp_str = postNum.text().substring(postNumSubstrSelection);
p_postNum = Integer.parseInt(tmp_str.substring(0, tmp_str.indexOf(" " + postRowSelection)));
}
//Find post's index //Find post's index
Element postIndex = item.select("a[name^=msg]").first(); Element postIndex = item.select("a[name^=msg]").first();
@ -194,30 +180,117 @@ class TopicParser {
p_postIndex = Integer.parseInt(tmp.substring(tmp.indexOf("msg") + 3)); p_postIndex = Integer.parseInt(tmp.substring(tmp.indexOf("msg") + 3));
} }
//Find attached file's urls, names and info, if present //Language dependent parsing
Elements postAttachments = item.select("div:containsOwn(" + postAttachedDiv Element userName;
+ "):containsOwn(" + postAttachedSubstr + ")"); if (Objects.equals(language, LANGUAGE_GREEK)) {
if (postAttachments != null) { //Find username
Elements attachedFiles = postAttachments.select("a"); userName = item.select("a[title^=Εμφάνιση προφίλ του μέλους]").first();
String postAttachmentsText = postAttachments.text(); if (userName == null) { //Deleted profile
p_isDeleted = true;
p_userName = item
.select("td:has(div.smalltext:containsOwn(Επισκέπτης))[style^=overflow]")
.first().text();
p_userName = p_userName.substring(0, p_userName.indexOf(" Επισκέπτης"));
p_userColor = USER_COLOR_BLACK;
} else {
p_userName = userName.html();
p_profileURL = userName.attr("href");
}
for(int i = 0; i<attachedFiles.size(); ++i){ //Find post's submit date
String[] attachedArray = new String[3]; Element postDate = item.select("div.smalltext:matches(στις:)").first();
p_postDate = postDate.text();
p_postDate = p_postDate.substring(p_postDate.indexOf("στις:") + 6
, p_postDate.indexOf(" »"));
//Find post's number
Element postNum = item.select("div.smalltext:matches(Απάντηση #)").first();
if (postNum == null) { //Topic starter
p_postNum = 0;
} else {
String tmp_str = postNum.text().substring(12);
p_postNum = Integer.parseInt(tmp_str.substring(0, tmp_str.indexOf(" στις")));
}
//Get file's url and filename
Element tmpAttachedFileUrlAndName = attachedFiles.get(i);
attachedArray[0] = tmpAttachedFileUrlAndName.attr("href");
attachedArray[1] = tmpAttachedFileUrlAndName.text().substring(1);
//Get file's info (size and download count) //Find attached file's urls, names and info, if present
String postAttachmentsTextSbstr = postAttachmentsText.substring( Elements postAttachments = item.select("div:containsOwn(έγινε λήψη):containsOwn(φορές.)");
postAttachmentsText.indexOf(attachedArray[1])); if (postAttachments != null) {
Elements attachedFiles = postAttachments.select("a");
String postAttachmentsText = postAttachments.text();
attachedArray[2] = postAttachmentsTextSbstr.substring(attachedArray[1].length() for (int i = 0; i < attachedFiles.size(); ++i) {
, postAttachmentsTextSbstr.indexOf(postAttachedSubstr)) String[] attachedArray = new String[3];
+ postAttachedSubstr + ")";
p_attachedFiles.add(attachedArray); //Get file's url and filename
Element tmpAttachedFileUrlAndName = attachedFiles.get(i);
attachedArray[0] = tmpAttachedFileUrlAndName.attr("href");
attachedArray[1] = tmpAttachedFileUrlAndName.text().substring(1);
//Get file's info (size and download count)
String postAttachmentsTextSbstr = postAttachmentsText.substring(
postAttachmentsText.indexOf(attachedArray[1]));
attachedArray[2] = postAttachmentsTextSbstr.substring(attachedArray[1]
.length(), postAttachmentsTextSbstr.indexOf("φορές.")) + "φορές.)";
p_attachedFiles.add(attachedArray);
}
}
} else {
//Find username
userName = item.select("a[title^=View the profile of]").first();
if (userName == null) { //Deleted profile
p_isDeleted = true;
p_userName = item
.select("td:has(div.smalltext:containsOwn(Guest))[style^=overflow]")
.first().text();
p_userName = p_userName.substring(0, p_userName.indexOf(" Guest"));
p_userColor = USER_COLOR_BLACK;
} else {
p_userName = userName.html();
p_profileURL = userName.attr("href");
}
//Find post's submit date
Element postDate = item.select("div.smalltext:matches(on:)").first();
p_postDate = postDate.text();
p_postDate = p_postDate.substring(p_postDate.indexOf("on:") + 4
, p_postDate.indexOf(" »"));
//Find post's number
Element postNum = item.select("div.smalltext:matches(Reply #)").first();
if (postNum == null) { //Topic starter
p_postNum = 0;
} else {
String tmp_str = postNum.text().substring(9);
p_postNum = Integer.parseInt(tmp_str.substring(0, tmp_str.indexOf(" on")));
}
//Find attached file's urls, names and info, if present
Elements postAttachments = item.select("div:containsOwn(downloaded):containsOwn(times.)");
if (postAttachments != null) {
Elements attachedFiles = postAttachments.select("a");
String postAttachmentsText = postAttachments.text();
for (int i = 0; i < attachedFiles.size(); ++i) {
String[] attachedArray = new String[3];
//Get file's url and filename
Element tmpAttachedFileUrlAndName = attachedFiles.get(i);
attachedArray[0] = tmpAttachedFileUrlAndName.attr("href");
attachedArray[1] = tmpAttachedFileUrlAndName.text().substring(1);
//Get file's info (size and download count)
String postAttachmentsTextSbstr = postAttachmentsText.substring(
postAttachmentsText.indexOf(attachedArray[1]));
attachedArray[2] = postAttachmentsTextSbstr.substring(attachedArray[1]
.length(), postAttachmentsTextSbstr.indexOf("times.")) + "times.)";
p_attachedFiles.add(attachedArray);
}
} }
} }
@ -229,24 +302,47 @@ class TopicParser {
Element info = userName.parent().nextElementSibling(); //Get sibling "div" Element info = userName.parent().nextElementSibling(); //Get sibling "div"
List<String> infoList = Arrays.asList(info.html().split("<br>")); List<String> infoList = Arrays.asList(info.html().split("<br>"));
for (String line : infoList) { if (Objects.equals(language, LANGUAGE_GREEK)) {
if (line.contains(numberOfPostsSelection)) { for (String line : infoList) {
postsLineIndex = infoList.indexOf(line); if (line.contains("Μηνύματα:")) {
//Remove any line breaks and spaces on the start and end postsLineIndex = infoList.indexOf(line);
p_numberOfPosts = line.replace("\n", "") //Remove any line breaks and spaces on the start and end
.replace("\r", "").trim(); p_numberOfPosts = line.replace("\n", "").replace("\r", "").trim();
} }
if (line.contains(genderSelection)) { if (line.contains("Φύλο:")) {
if (line.contains("alt=\"" + genderAltMale + "\"")) if (line.contains("alt=\"Άντρας\""))
p_gender = genderSelection + " " + genderAltMale; p_gender = "Φύλο: Άντρας";
else else
p_gender = genderSelection + " " + genderAltFemale; p_gender = "Φύλο: Γυναίκα";
}
if (line.contains("alt=\"*\"")) {
starsLineIndex = infoList.indexOf(line);
Document starsHtml = Jsoup.parse(line);
p_numberOfStars = starsHtml.select("img[alt]").size();
p_userColor = colorPicker(starsHtml.select("img[alt]").first()
.attr("abs:src"));
}
} }
if (line.contains("alt=\"*\"")) { } else {
starsLineIndex = infoList.indexOf(line); for (String line : infoList) {
Document starsHtml = Jsoup.parse(line); if (line.contains("Posts:")) {
p_numberOfStars = starsHtml.select("img[alt]").size(); postsLineIndex = infoList.indexOf(line);
p_userColor = colorPicker(starsHtml.select("img[alt]").first().attr("abs:src")); //Remove any line breaks and spaces on the start and end
p_numberOfPosts = line.replace("\n", "").replace("\r", "").trim();
}
if (line.contains("Gender:")) {
if (line.contains("alt=\"Male\""))
p_gender = "Gender: Male";
else
p_gender = "Gender: Female";
}
if (line.contains("alt=\"*\"")) {
starsLineIndex = infoList.indexOf(line);
Document starsHtml = Jsoup.parse(line);
p_numberOfStars = starsHtml.select("img[alt]").size();
p_userColor = colorPicker(starsHtml.select("img[alt]").first()
.attr("abs:src"));
}
} }
} }
@ -272,99 +368,44 @@ class TopicParser {
&& !thisLine.contains("<a href=")) { && !thisLine.contains("<a href=")) {
p_personalText = thisLine; //Then this line has user's personal text p_personalText = thisLine; //Then this line has user's personal text
//Remove any line breaks and spaces on the start and end //Remove any line breaks and spaces on the start and end
p_personalText = p_personalText.replace("\n", "") p_personalText = p_personalText.replace("\n", "").replace("\r", "").trim();
.replace("\r", "").trim();
} }
} }
//Add new post in postsList, extended information needed //Add new post in postsList, extended information needed
returnList.add(new Post(p_thumbnailUrl, p_userName, p_subject, p_post returnList.add(new Post(p_thumbnailUrl, p_userName, p_subject, p_post, p_postIndex
, p_postIndex, p_postNum, p_postDate, p_profileURL, p_rank , p_postNum, p_postDate, p_profileURL, p_rank, p_specialRank, p_gender
, p_specialRank, p_gender, p_numberOfPosts, p_personalText , p_numberOfPosts, p_personalText, p_numberOfStars, p_userColor
, p_numberOfStars, p_userColor, p_attachedFiles)); , p_attachedFiles));
} else { //Deleted user } else { //Deleted user
//Add new post in postsList, only standard information needed //Add new post in postsList, only standard information needed
returnList.add(new Post(p_thumbnailUrl, p_userName, p_subject, p_post returnList.add(new Post(p_thumbnailUrl, p_userName, p_subject, p_post, p_postIndex
, p_postIndex, p_postNum, p_postDate, p_userColor, p_attachedFiles)); , p_postNum, p_postDate, p_userColor, p_attachedFiles));
} }
} }
return returnList; return returnList;
} }
private static void defineLanguage(Document doc){ static String defineLanguage(Document doc) {
//English parsing variables if (doc.select("h3").text().contains("Καλώς ορίσατε")) {
final String en_usersViewingTopic = "are viewing this topic"; return LANGUAGE_GREEK;
final String en_currentPage = "Pages:"; } else { //Default is english (eg. guest's language)
final String en_postRowSelection = "on"; return LANGUAGE_ENGLISH;
final String en_userNameSelection = "View the profile of";
final String en_guestSelection = "Guest";
final String en_postAttachedDiv = "downloaded";
final String en_postAttachedSubstr = "times.";
final String en_postsNumberSelection = "Reply #";
final String en_numberOfPostsSelection = "Posts:";
final String en_genderSelection = "Gender:";
final String en_genderAltMale = "Male";
final String en_genderAltFemale = "Female";
//Greek parsing variables
final String gr_usersViewingTopic = "διαβάζουν αυτό το θέμα";
final String gr_currentPage = "Σελίδες:";
final String gr_postRowSelection = "στις";
final String gr_userNameSelection = "Εμφάνιση προφίλ του μέλους";
final String gr_guestSelection = "Επισκέπτης";
final String gr_postAttachedDiv = "έγινε λήψη";
final String gr_postAttachedSubstr = "φορές.";
final String gr_postsNumberSelection = "Απάντηση #";
final String gr_numberOfPostsSelection = "Μηνύματα:";
final String gr_genderSelection = "Φύλο:";
final String gr_genderAltMale = "Άντρας";
final String gr_genderAltFemale = "Γυναίκα";
if(doc.select("h3").text().contains("Καλώς ορίσατε")){
usersViewingTopic = gr_usersViewingTopic;
currentPage = gr_currentPage;
postRowSelection = gr_postRowSelection;
userNameSelection = gr_userNameSelection;
guestSelection = gr_guestSelection;
postAttachedDiv = gr_postAttachedDiv;
postAttachedSubstr = gr_postAttachedSubstr;
postDateSubstrSelection = 6;
postNumberSelection = gr_postsNumberSelection;
postNumSubstrSelection = 12;
numberOfPostsSelection = gr_numberOfPostsSelection;
genderSelection = gr_genderSelection;
genderAltMale = gr_genderAltMale;
genderAltFemale = gr_genderAltFemale;
}
else{ //Default is english (eg. guest's language)
usersViewingTopic = en_usersViewingTopic;
currentPage = en_currentPage;
postRowSelection = en_postRowSelection;
userNameSelection = en_userNameSelection;
guestSelection = en_guestSelection;
postAttachedDiv = en_postAttachedDiv;
postAttachedSubstr = en_postAttachedSubstr;
postDateSubstrSelection = 4;
postNumberSelection = en_postsNumberSelection;
postNumSubstrSelection = 9;
numberOfPostsSelection = en_numberOfPostsSelection;
genderSelection = en_genderSelection;
genderAltMale = en_genderAltMale;
genderAltFemale = en_genderAltFemale;
} }
} }
private static int colorPicker(String starsUrl){
if(starsUrl.contains("/star.gif")) private static int colorPicker(String starsUrl) {
if (starsUrl.contains("/star.gif"))
return USER_COLOR_YELLOW; return USER_COLOR_YELLOW;
else if(starsUrl.contains("/starmod.gif")) else if (starsUrl.contains("/starmod.gif"))
return USER_COLOR_GREEN; return USER_COLOR_GREEN;
else if(starsUrl.contains("/stargmod.gif")) else if (starsUrl.contains("/stargmod.gif"))
return USER_COLOR_BLUE; return USER_COLOR_BLUE;
else if(starsUrl.contains("/staradmin.gif")) else if (starsUrl.contains("/staradmin.gif"))
return USER_COLOR_RED; return USER_COLOR_RED;
else if(starsUrl.contains("/starweb.gif")) else if (starsUrl.contains("/starweb.gif"))
return USER_COLOR_BLACK; return USER_COLOR_BLACK;
else if(starsUrl.contains("/oscar.gif")) else if (starsUrl.contains("/oscar.gif"))
return USER_COLOR_PINK; return USER_COLOR_PINK;
return USER_COLOR_YELLOW; return USER_COLOR_YELLOW;
} }

Loading…
Cancel
Save