|
|
@ -217,6 +217,7 @@ public class ProfileActivity extends BaseActivity implements LatestPostsFragment |
|
|
|
//Class variables
|
|
|
|
Document profilePage; |
|
|
|
Spannable usernameSpan; |
|
|
|
Boolean isOnline = false; |
|
|
|
|
|
|
|
protected void onPreExecute() { |
|
|
|
progressBar.setVisibility(ProgressBar.VISIBLE); |
|
|
@ -261,13 +262,17 @@ public class ProfileActivity extends BaseActivity implements LatestPostsFragment |
|
|
|
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); |
|
|
|
usernameSpan.setSpan(new RelativeSizeSpan(0.45f) |
|
|
|
, 0, 2, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); |
|
|
|
|
|
|
|
if (contentsTable.toString().contains("Online") |
|
|
|
|| contentsTable.toString().contains("Συνδεδεμένος")) { |
|
|
|
usernameSpan.setSpan(new ForegroundColorSpan(Color.parseColor("#4CAF50")) |
|
|
|
, 0, 2, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); |
|
|
|
} else |
|
|
|
usernameSpan.setSpan(new ForegroundColorSpan(Color.GRAY) |
|
|
|
, 0, 2, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); |
|
|
|
isOnline = true; |
|
|
|
} else { |
|
|
|
isOnline = false; |
|
|
|
/*usernameSpan.setSpan(new ForegroundColorSpan(Color.GRAY) |
|
|
|
, 0, 3, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);*/ |
|
|
|
} |
|
|
|
usernameSpan.setSpan(new ForegroundColorSpan(Color.parseColor("#26A69A")) |
|
|
|
, 2, usernameSpan.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); |
|
|
|
} |
|
|
|
return true; |
|
|
|
} catch (SSLHandshakeException e) { |
|
|
@ -290,8 +295,14 @@ public class ProfileActivity extends BaseActivity implements LatestPostsFragment |
|
|
|
if (pmFAB.getVisibility() != View.GONE) pmFAB.setEnabled(true); |
|
|
|
progressBar.setVisibility(ProgressBar.INVISIBLE); |
|
|
|
|
|
|
|
if (usernameSpan != null) usernameView.setText(usernameSpan); |
|
|
|
else if (usernameView.getText() != username) usernameView.setText(username); |
|
|
|
if (usernameSpan != null) { |
|
|
|
if (isOnline) { |
|
|
|
usernameView.setTextColor(Color.parseColor("#4CAF50")); |
|
|
|
} else { |
|
|
|
usernameView.setTextColor(Color.GRAY); |
|
|
|
} |
|
|
|
usernameView.setText(usernameSpan); |
|
|
|
} else if (usernameView.getText() != username) usernameView.setText(username); |
|
|
|
if (thumbnailUrl != null && !Objects.equals(thumbnailUrl, "")) |
|
|
|
//noinspection ConstantConditions
|
|
|
|
Picasso.with(getApplicationContext()) |
|
|
|