Improve UX - Fix issue #546
This commit is contained in:
parent
a0d7ed4efa
commit
0cbb9e0d8e
|
@ -151,6 +151,7 @@ import static fr.gouv.etalab.mastodon.helper.Helper.SEARCH_INSTANCE;
|
|||
import static fr.gouv.etalab.mastodon.helper.Helper.SEARCH_REMOTE;
|
||||
import static fr.gouv.etalab.mastodon.helper.Helper.SEARCH_URL;
|
||||
import static fr.gouv.etalab.mastodon.helper.Helper.THEME_BLACK;
|
||||
import static fr.gouv.etalab.mastodon.helper.Helper.THEME_LIGHT;
|
||||
import static fr.gouv.etalab.mastodon.helper.Helper.changeDrawableColor;
|
||||
import static fr.gouv.etalab.mastodon.helper.Helper.changeUser;
|
||||
import static fr.gouv.etalab.mastodon.helper.Helper.menuAccounts;
|
||||
|
@ -268,7 +269,7 @@ public abstract class BaseMainActivity extends BaseActivity
|
|||
|
||||
@SuppressWarnings("ConstantConditions") @SuppressLint("CutPasteId")
|
||||
ImageView iconHome = tabHome.getCustomView().findViewById(R.id.tab_icon);
|
||||
iconHome.setColorFilter(ContextCompat.getColor(getApplicationContext(), R.color.dark_text), PorterDuff.Mode.SRC_IN);
|
||||
|
||||
iconHome.setImageResource(R.drawable.ic_home);
|
||||
|
||||
if( theme == THEME_BLACK)
|
||||
|
@ -279,25 +280,36 @@ public abstract class BaseMainActivity extends BaseActivity
|
|||
|
||||
@SuppressWarnings("ConstantConditions") @SuppressLint("CutPasteId")
|
||||
ImageView iconNotif = tabNotif.getCustomView().findViewById(R.id.tab_icon);
|
||||
iconNotif.setColorFilter(ContextCompat.getColor(getApplicationContext(), R.color.dark_text), PorterDuff.Mode.SRC_IN);
|
||||
iconNotif.setImageResource(R.drawable.ic_notifications);
|
||||
|
||||
|
||||
@SuppressWarnings("ConstantConditions") @SuppressLint("CutPasteId")
|
||||
ImageView iconDirect = tabDirect.getCustomView().findViewById(R.id.tab_icon);
|
||||
iconDirect.setColorFilter(ContextCompat.getColor(getApplicationContext(), R.color.dark_text), PorterDuff.Mode.SRC_IN);
|
||||
iconDirect.setImageResource(R.drawable.ic_direct_messages);
|
||||
|
||||
@SuppressWarnings("ConstantConditions") @SuppressLint("CutPasteId")
|
||||
ImageView iconLocal = tabLocal.getCustomView().findViewById(R.id.tab_icon);
|
||||
iconLocal.setColorFilter(ContextCompat.getColor(getApplicationContext(), R.color.dark_text), PorterDuff.Mode.SRC_IN);
|
||||
iconLocal.setImageResource(R.drawable.ic_people);
|
||||
|
||||
@SuppressWarnings("ConstantConditions") @SuppressLint("CutPasteId")
|
||||
ImageView iconGlobal = tabPublic.getCustomView().findViewById(R.id.tab_icon);
|
||||
iconGlobal.setColorFilter(ContextCompat.getColor(getApplicationContext(), R.color.dark_text), PorterDuff.Mode.SRC_IN);
|
||||
iconGlobal.setImageResource(R.drawable.ic_public);
|
||||
|
||||
if( theme == THEME_LIGHT){
|
||||
iconHome.setColorFilter(ContextCompat.getColor(getApplicationContext(), R.color.dark_icon), PorterDuff.Mode.SRC_IN);
|
||||
iconNotif.setColorFilter(ContextCompat.getColor(getApplicationContext(), R.color.dark_icon), PorterDuff.Mode.SRC_IN);
|
||||
iconDirect.setColorFilter(ContextCompat.getColor(getApplicationContext(), R.color.dark_icon), PorterDuff.Mode.SRC_IN);
|
||||
iconLocal.setColorFilter(ContextCompat.getColor(getApplicationContext(), R.color.dark_icon), PorterDuff.Mode.SRC_IN);
|
||||
iconGlobal.setColorFilter(ContextCompat.getColor(getApplicationContext(), R.color.dark_icon), PorterDuff.Mode.SRC_IN);
|
||||
}else {
|
||||
iconHome.setColorFilter(ContextCompat.getColor(getApplicationContext(), R.color.dark_text), PorterDuff.Mode.SRC_IN);
|
||||
iconNotif.setColorFilter(ContextCompat.getColor(getApplicationContext(), R.color.dark_text), PorterDuff.Mode.SRC_IN);
|
||||
iconDirect.setColorFilter(ContextCompat.getColor(getApplicationContext(), R.color.dark_text), PorterDuff.Mode.SRC_IN);
|
||||
iconLocal.setColorFilter(ContextCompat.getColor(getApplicationContext(), R.color.dark_text), PorterDuff.Mode.SRC_IN);
|
||||
iconGlobal.setColorFilter(ContextCompat.getColor(getApplicationContext(), R.color.dark_text), PorterDuff.Mode.SRC_IN);
|
||||
}
|
||||
|
||||
|
||||
FloatingActionButton federatedTimelines = findViewById(R.id.federated_timeline);
|
||||
|
||||
delete_instance.setOnClickListener(new View.OnClickListener() {
|
||||
|
@ -630,11 +642,20 @@ public abstract class BaseMainActivity extends BaseActivity
|
|||
}
|
||||
});
|
||||
|
||||
changeDrawableColor(getApplicationContext(), R.drawable.ic_home,R.color.dark_text);
|
||||
changeDrawableColor(getApplicationContext(), R.drawable.ic_notifications,R.color.dark_text);
|
||||
changeDrawableColor(getApplicationContext(), R.drawable.ic_direct_messages,R.color.dark_text);
|
||||
changeDrawableColor(getApplicationContext(), R.drawable.ic_people,R.color.dark_text);
|
||||
changeDrawableColor(getApplicationContext(), R.drawable.ic_public,R.color.dark_text);
|
||||
if( theme == THEME_LIGHT){
|
||||
changeDrawableColor(getApplicationContext(), R.drawable.ic_home,R.color.dark_icon);
|
||||
changeDrawableColor(getApplicationContext(), R.drawable.ic_notifications,R.color.dark_icon);
|
||||
changeDrawableColor(getApplicationContext(), R.drawable.ic_direct_messages,R.color.dark_icon);
|
||||
changeDrawableColor(getApplicationContext(), R.drawable.ic_people,R.color.dark_icon);
|
||||
changeDrawableColor(getApplicationContext(), R.drawable.ic_public,R.color.dark_icon);
|
||||
}else {
|
||||
changeDrawableColor(getApplicationContext(), R.drawable.ic_home,R.color.dark_text);
|
||||
changeDrawableColor(getApplicationContext(), R.drawable.ic_notifications,R.color.dark_text);
|
||||
changeDrawableColor(getApplicationContext(), R.drawable.ic_direct_messages,R.color.dark_text);
|
||||
changeDrawableColor(getApplicationContext(), R.drawable.ic_people,R.color.dark_text);
|
||||
changeDrawableColor(getApplicationContext(), R.drawable.ic_public,R.color.dark_text);
|
||||
}
|
||||
|
||||
|
||||
startSreaming();
|
||||
tabLayout.setTabGravity(TabLayout.GRAVITY_FILL);
|
||||
|
@ -819,7 +840,10 @@ public abstract class BaseMainActivity extends BaseActivity
|
|||
if( tab.getCustomView() != null) {
|
||||
ImageView icon = tab.getCustomView().findViewById(R.id.tab_icon);
|
||||
if( icon != null)
|
||||
icon.setColorFilter(ContextCompat.getColor(getApplicationContext(), R.color.white), PorterDuff.Mode.SRC_IN);
|
||||
if( theme == THEME_LIGHT)
|
||||
icon.setColorFilter(ContextCompat.getColor(getApplicationContext(), R.color.dark_icon), PorterDuff.Mode.SRC_IN);
|
||||
else
|
||||
icon.setColorFilter(ContextCompat.getColor(getApplicationContext(), R.color.dark_text), PorterDuff.Mode.SRC_IN);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -68,6 +68,9 @@ import fr.gouv.etalab.mastodon.interfaces.OnRetrieveEmojiInterface;
|
|||
import static fr.gouv.etalab.mastodon.helper.Helper.INTENT_ACTION;
|
||||
import static fr.gouv.etalab.mastodon.helper.Helper.SEARCH_REMOTE;
|
||||
import static fr.gouv.etalab.mastodon.helper.Helper.SEARCH_URL;
|
||||
import static fr.gouv.etalab.mastodon.helper.Helper.THEME_BLACK;
|
||||
import static fr.gouv.etalab.mastodon.helper.Helper.THEME_DARK;
|
||||
import static fr.gouv.etalab.mastodon.helper.Helper.THEME_LIGHT;
|
||||
|
||||
/**
|
||||
* Created by Thomas on 23/04/2017.
|
||||
|
@ -747,9 +750,18 @@ public class Status implements Parcelable{
|
|||
},
|
||||
matchStart, matchEnd,
|
||||
Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||
if( matchEnd <= spannableString.toString().length() && matchEnd >= matchStart)
|
||||
spannableString.setSpan(new ForegroundColorSpan(ContextCompat.getColor(context, (theme==Helper.THEME_DARK||theme==Helper.THEME_BLACK)?R.color.mastodonC2:R.color.mastodonC4)), matchStart, matchEnd,
|
||||
Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||
if( matchEnd <= spannableString.toString().length() && matchEnd >= matchStart){
|
||||
if( theme == THEME_DARK)
|
||||
spannableString.setSpan(new ForegroundColorSpan(ContextCompat.getColor(context, R.color.dark_link_toot)), matchStart, matchEnd,
|
||||
Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||
else if( theme == THEME_BLACK)
|
||||
spannableString.setSpan(new ForegroundColorSpan(ContextCompat.getColor(context, R.color.black_link_toot)), matchStart, matchEnd,
|
||||
Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||
else if( theme == THEME_LIGHT)
|
||||
spannableString.setSpan(new ForegroundColorSpan(ContextCompat.getColor(context, R.color.mastodonC4)), matchStart, matchEnd,
|
||||
Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||
}
|
||||
|
||||
}
|
||||
SpannableString spannableStringT;
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
|
||||
|
@ -782,8 +794,17 @@ public class Status implements Parcelable{
|
|||
}
|
||||
}, matchStart, matchEnd, Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||
if( matchEnd <= spannableStringT.toString().length() && matchEnd >= matchStart)
|
||||
spannableStringT.setSpan(new ForegroundColorSpan(ContextCompat.getColor(context, (theme==Helper.THEME_DARK||theme==Helper.THEME_BLACK)?R.color.mastodonC2:R.color.mastodonC4)), matchStart, matchEnd,
|
||||
Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||
if( matchEnd <= spannableString.toString().length() && matchEnd >= matchStart) {
|
||||
if (theme == THEME_DARK)
|
||||
spannableStringT.setSpan(new ForegroundColorSpan(ContextCompat.getColor(context, R.color.dark_link_toot)), matchStart, matchEnd,
|
||||
Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||
else if (theme == THEME_BLACK)
|
||||
spannableStringT.setSpan(new ForegroundColorSpan(ContextCompat.getColor(context, R.color.black_link_toot)), matchStart, matchEnd,
|
||||
Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||
else if (theme == THEME_LIGHT)
|
||||
spannableStringT.setSpan(new ForegroundColorSpan(ContextCompat.getColor(context, R.color.mastodonC4)), matchStart, matchEnd,
|
||||
Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||
}
|
||||
}
|
||||
|
||||
if( accountsMentionUnknown.size() > 0 ) {
|
||||
|
@ -807,9 +828,17 @@ public class Status implements Parcelable{
|
|||
},
|
||||
startPosition, endPosition,
|
||||
Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||
if(endPosition <= spannableStringT.toString().length() && endPosition >= startPosition)
|
||||
spannableStringT.setSpan(new ForegroundColorSpan(ContextCompat.getColor(context, (theme==Helper.THEME_DARK||theme==Helper.THEME_BLACK)?R.color.mastodonC2:R.color.mastodonC4)), startPosition, endPosition,
|
||||
Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||
if(endPosition <= spannableStringT.toString().length() && endPosition >= startPosition){
|
||||
if (theme == THEME_DARK)
|
||||
spannableStringT.setSpan(new ForegroundColorSpan(ContextCompat.getColor(context, R.color.dark_link_toot)), startPosition, endPosition,
|
||||
Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||
else if (theme == THEME_BLACK)
|
||||
spannableStringT.setSpan(new ForegroundColorSpan(ContextCompat.getColor(context, R.color.dark_link_toot)), startPosition, endPosition,
|
||||
Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||
else if (theme == THEME_LIGHT)
|
||||
spannableStringT.setSpan(new ForegroundColorSpan(ContextCompat.getColor(context, R.color.mastodonC4)), startPosition, endPosition,
|
||||
Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -867,9 +896,17 @@ public class Status implements Parcelable{
|
|||
startPosition, endPosition,
|
||||
Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||
}
|
||||
if(endPosition <= spannableStringT.toString().length() && endPosition >= startPosition)
|
||||
spannableStringT.setSpan(new ForegroundColorSpan(ContextCompat.getColor(context, (theme==Helper.THEME_DARK||theme==Helper.THEME_BLACK)?R.color.mastodonC2:R.color.mastodonC4)), startPosition, endPosition,
|
||||
Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||
if(endPosition <= spannableStringT.toString().length() && endPosition >= startPosition){
|
||||
if (theme == THEME_DARK)
|
||||
spannableStringT.setSpan(new ForegroundColorSpan(ContextCompat.getColor(context, R.color.dark_link_toot)), startPosition, endPosition,
|
||||
Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||
else if (theme == THEME_BLACK)
|
||||
spannableStringT.setSpan(new ForegroundColorSpan(ContextCompat.getColor(context, R.color.black_link_toot)), startPosition, endPosition,
|
||||
Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||
else if (theme == THEME_LIGHT)
|
||||
spannableStringT.setSpan(new ForegroundColorSpan(ContextCompat.getColor(context, R.color.mastodonC4)), startPosition, endPosition,
|
||||
Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||
}
|
||||
}
|
||||
}
|
||||
it.remove();
|
||||
|
@ -903,9 +940,17 @@ public class Status implements Parcelable{
|
|||
},
|
||||
startPosition, endPosition,
|
||||
Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||
if(endPosition <= spannableStringT.toString().length() && endPosition >= startPosition)
|
||||
spannableStringT.setSpan(new ForegroundColorSpan(ContextCompat.getColor(context, (theme==Helper.THEME_DARK||theme==Helper.THEME_BLACK)?R.color.mastodonC2:R.color.mastodonC4)), startPosition, endPosition,
|
||||
Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||
if(endPosition <= spannableStringT.toString().length() && endPosition >= startPosition){
|
||||
if (theme == THEME_DARK)
|
||||
spannableStringT.setSpan(new ForegroundColorSpan(ContextCompat.getColor(context, R.color.dark_link_toot)), startPosition, endPosition,
|
||||
Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||
else if (theme == THEME_BLACK)
|
||||
spannableStringT.setSpan(new ForegroundColorSpan(ContextCompat.getColor(context, R.color.black_link_toot)), startPosition, endPosition,
|
||||
Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||
else if (theme == THEME_LIGHT)
|
||||
spannableStringT.setSpan(new ForegroundColorSpan(ContextCompat.getColor(context, R.color.mastodonC4)), startPosition, endPosition,
|
||||
Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -932,9 +977,17 @@ public class Status implements Parcelable{
|
|||
ds.setUnderlineText(false);
|
||||
}
|
||||
}, matchStart, matchEnd, Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||
if( matchEnd <= spannableStringT.toString().length() && matchEnd >= matchStart)
|
||||
spannableStringT.setSpan(new ForegroundColorSpan(ContextCompat.getColor(context, (theme==Helper.THEME_DARK||theme==Helper.THEME_BLACK)?R.color.mastodonC2:R.color.mastodonC4)), matchStart, matchEnd,
|
||||
Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||
if( matchEnd <= spannableStringT.toString().length() && matchEnd >= matchStart){
|
||||
if (theme == THEME_DARK)
|
||||
spannableStringT.setSpan(new ForegroundColorSpan(ContextCompat.getColor(context, R.color.dark_link_toot)), matchStart, matchEnd,
|
||||
Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||
else if (theme == THEME_BLACK)
|
||||
spannableStringT.setSpan(new ForegroundColorSpan(ContextCompat.getColor(context, R.color.black_link_toot)), matchStart, matchEnd,
|
||||
Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||
else if (theme == THEME_LIGHT)
|
||||
spannableStringT.setSpan(new ForegroundColorSpan(ContextCompat.getColor(context, R.color.mastodonC4)), matchStart, matchEnd,
|
||||
Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||
}
|
||||
}
|
||||
return spannableStringT;
|
||||
}
|
||||
|
|
|
@ -505,32 +505,43 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
|||
|
||||
boolean expand_cw = sharedpreferences.getBoolean(Helper.SET_EXPAND_CW, false);
|
||||
boolean expand_media = sharedpreferences.getBoolean(Helper.SET_EXPAND_MEDIA, false);
|
||||
if( theme == Helper.THEME_DARK || theme == Helper.THEME_BLACK){
|
||||
if( theme == Helper.THEME_BLACK){
|
||||
changeDrawableColor(context, R.drawable.ic_reply,R.color.dark_icon);
|
||||
changeDrawableColor(context, holder.status_more, R.color.dark_icon);
|
||||
changeDrawableColor(context, holder.status_privacy, R.color.dark_icon);
|
||||
changeDrawableColor(context, R.drawable.ic_repeat,R.color.dark_icon);
|
||||
changeDrawableColor(context, R.drawable.ic_repeat_head_toot,R.color.black_text_toot_header);
|
||||
changeDrawableColor(context, R.drawable.ic_star_border,R.color.dark_icon);
|
||||
changeDrawableColor(context, R.drawable.ic_plus_one,R.color.dark_icon);
|
||||
changeDrawableColor(context, R.drawable.ic_pin_drop, R.color.dark_icon);
|
||||
changeDrawableColor(context, R.drawable.ic_photo,R.color.dark_text);
|
||||
changeDrawableColor(context, R.drawable.ic_remove_red_eye,R.color.dark_text);
|
||||
changeDrawableColor(context, R.drawable.ic_translate,R.color.dark_text);
|
||||
holder.status_favorite_count.setTextColor(ContextCompat.getColor(context, R.color.dark_icon));
|
||||
holder.status_reblog_count.setTextColor(ContextCompat.getColor(context, R.color.dark_icon));
|
||||
holder.status_reply.setTextColor(ContextCompat.getColor(context, R.color.dark_icon));
|
||||
}else if( theme == Helper.THEME_DARK ){
|
||||
changeDrawableColor(context, R.drawable.ic_reply,R.color.dark_icon);
|
||||
changeDrawableColor(context, holder.status_more, R.color.dark_icon);
|
||||
changeDrawableColor(context, R.drawable.ic_repeat,R.color.dark_icon);
|
||||
changeDrawableColor(context, holder.status_privacy, R.color.dark_icon);
|
||||
changeDrawableColor(context, R.drawable.ic_repeat_head_toot,R.color.dark_text_toot_header);
|
||||
changeDrawableColor(context, R.drawable.ic_star_border,R.color.dark_icon);
|
||||
changeDrawableColor(context, R.drawable.ic_plus_one,R.color.dark_icon);
|
||||
changeDrawableColor(context, R.drawable.ic_pin_drop, R.color.dark_icon);
|
||||
changeDrawableColor(context, R.drawable.ic_photo,R.color.dark_text);
|
||||
changeDrawableColor(context, R.drawable.ic_remove_red_eye,R.color.dark_text);
|
||||
changeDrawableColor(context, R.drawable.ic_translate,R.color.dark_text);
|
||||
|
||||
holder.status_favorite_count.setTextColor(ContextCompat.getColor(context, R.color.dark_icon));
|
||||
holder.status_reblog_count.setTextColor(ContextCompat.getColor(context, R.color.dark_icon));
|
||||
holder.status_reply.setTextColor(ContextCompat.getColor(context, R.color.dark_icon));
|
||||
holder.status_toot_date.setTextColor(ContextCompat.getColor(context, R.color.dark_icon));
|
||||
if( status.getReblog() != null)
|
||||
holder.status_account_displayname.setTextColor(ContextCompat.getColor(context, R.color.dark_icon));
|
||||
else
|
||||
holder.status_account_displayname.setTextColor(ContextCompat.getColor(context, R.color.dark_text));
|
||||
}else {
|
||||
changeDrawableColor(context, R.drawable.ic_reply,R.color.black);
|
||||
changeDrawableColor(context, R.drawable.ic_more_horiz,R.color.black);
|
||||
changeDrawableColor(context, holder.status_more, R.color.black);
|
||||
changeDrawableColor(context, holder.status_privacy, R.color.black);
|
||||
changeDrawableColor(context, R.drawable.ic_repeat,R.color.black);
|
||||
changeDrawableColor(context, R.drawable.ic_repeat_head_toot,R.color.black);
|
||||
changeDrawableColor(context, R.drawable.ic_plus_one,R.color.black);
|
||||
changeDrawableColor(context, R.drawable.ic_star_border,R.color.black);
|
||||
changeDrawableColor(context, R.drawable.ic_pin_drop, R.color.black);
|
||||
|
@ -541,11 +552,18 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
|||
changeDrawableColor(context, R.drawable.ic_bookmark_border,R.color.black);
|
||||
holder.status_favorite_count.setTextColor(ContextCompat.getColor(context, R.color.black));
|
||||
holder.status_reblog_count.setTextColor(ContextCompat.getColor(context, R.color.black));
|
||||
holder.status_toot_date.setTextColor(ContextCompat.getColor(context, R.color.black));
|
||||
holder.status_reply.setTextColor(ContextCompat.getColor(context, R.color.black));
|
||||
holder.status_account_displayname.setTextColor(ContextCompat.getColor(context, R.color.black));
|
||||
}
|
||||
|
||||
if( theme == THEME_DARK) {
|
||||
holder.status_account_displayname.setTextColor(ContextCompat.getColor(context, R.color.dark_text_toot_header));
|
||||
holder.status_toot_date.setTextColor(ContextCompat.getColor(context, R.color.dark_text_toot_header));
|
||||
}else if( theme == THEME_BLACK) {
|
||||
holder.status_account_displayname.setTextColor(ContextCompat.getColor(context, R.color.black_text_toot_header));
|
||||
holder.status_toot_date.setTextColor(ContextCompat.getColor(context, R.color.black_text_toot_header));
|
||||
}else if( theme == THEME_LIGHT) {
|
||||
holder.status_account_displayname.setTextColor(ContextCompat.getColor(context, R.color.black));
|
||||
holder.status_toot_date.setTextColor(ContextCompat.getColor(context, R.color.black));
|
||||
}
|
||||
if( status.isBookmarked())
|
||||
holder.status_bookmark.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.ic_bookmark));
|
||||
else
|
||||
|
@ -555,7 +573,7 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
|||
//Redraws top icons (boost/reply)
|
||||
final float scale = context.getResources().getDisplayMetrics().density;
|
||||
if( status.getReblog() != null){
|
||||
Drawable img = ContextCompat.getDrawable(context, R.drawable.ic_repeat);
|
||||
Drawable img = ContextCompat.getDrawable(context, R.drawable.ic_repeat_head_toot);
|
||||
assert img != null;
|
||||
img.setBounds(0,0,(int) (20 * iconSizePercent/100 * scale + 0.5f),(int) (15 * iconSizePercent/100 * scale + 0.5f));
|
||||
holder.status_account_displayname.setCompoundDrawables( img, null, null, null);
|
||||
|
@ -688,6 +706,7 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
|||
final String ppurl;
|
||||
if( status.getReblog() != null){
|
||||
ppurl = status.getReblog().getAccount().getAvatar();
|
||||
holder.status_account_displayname.setVisibility(View.VISIBLE);
|
||||
holder.status_account_displayname.setText(context.getResources().getString(R.string.reblog_by, status.getAccount().getUsername()));
|
||||
if( status.getReblog().getAccount().getDisplay_name().length() > 0)
|
||||
holder.status_account_displayname_owner.setText( status.getReblog().getAccount().getDisplay_name());
|
||||
|
@ -697,11 +716,11 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
|||
|
||||
}else {
|
||||
ppurl = status.getAccount().getAvatar();
|
||||
holder.status_account_displayname_owner.setVisibility(View.GONE);
|
||||
holder.status_account_displayname.setVisibility(View.GONE);
|
||||
if( status.getAccount().getdisplayNameSpan() == null || status.getAccount().getdisplayNameSpan().toString().trim().length() == 0)
|
||||
holder.status_account_displayname.setText(status.getAccount().getUsername().replace("@",""), TextView.BufferType.SPANNABLE);
|
||||
holder.status_account_displayname_owner.setText(status.getAccount().getUsername().replace("@",""), TextView.BufferType.SPANNABLE);
|
||||
else
|
||||
holder.status_account_displayname.setText(status.getAccount().getdisplayNameSpan(), TextView.BufferType.SPANNABLE);
|
||||
holder.status_account_displayname_owner.setText(status.getAccount().getdisplayNameSpan(), TextView.BufferType.SPANNABLE);
|
||||
}
|
||||
//-------- END -> Displays name & emoji in toot header
|
||||
|
||||
|
@ -721,8 +740,10 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
|||
if( wordtoSpan.length() >= matchEnd && matchStart < matchEnd){
|
||||
if( theme == THEME_LIGHT)
|
||||
wordtoSpan.setSpan(new ForegroundColorSpan(ContextCompat.getColor(context, R.color.dark_icon)), matchStart, matchEnd, Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||
else
|
||||
wordtoSpan.setSpan(new ForegroundColorSpan(ContextCompat.getColor(context, R.color.mastodonC2)), matchStart, matchEnd, Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||
else if( theme == THEME_DARK)
|
||||
wordtoSpan.setSpan(new ForegroundColorSpan(ContextCompat.getColor(context, R.color.dark_text_toot_header)), matchStart, matchEnd, Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||
else if( theme == THEME_BLACK)
|
||||
wordtoSpan.setSpan(new ForegroundColorSpan(ContextCompat.getColor(context, R.color.black_text_toot_header)), matchStart, matchEnd, Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1091,22 +1112,9 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
|||
|
||||
|
||||
|
||||
/* if( theme == Helper.THEME_LIGHT){
|
||||
holder.main_container.setBackgroundResource(R.color.mastodonC3__);
|
||||
}else if (theme == Helper.THEME_DARK){
|
||||
holder.main_container.setBackgroundResource(R.color.mastodonC1_);
|
||||
}else if (theme == Helper.THEME_BLACK){
|
||||
holder.main_container.setBackgroundResource(R.color.black);
|
||||
}*/
|
||||
if( type == RetrieveFeedsAsyncTask.Type.CONTEXT ){
|
||||
|
||||
if( position == conversationPosition){
|
||||
/* if( theme == Helper.THEME_LIGHT)
|
||||
holder.main_container.setBackgroundResource(R.color.mastodonC3_);
|
||||
else if( theme == Helper.THEME_DARK)
|
||||
holder.main_container.setBackgroundResource(R.color.mastodonC1___);
|
||||
else if( theme == Helper.THEME_BLACK)
|
||||
holder.main_container.setBackgroundResource(R.color.black_2);*/
|
||||
if( status.getCard() != null){
|
||||
|
||||
holder.status_cardview_content.setText(status.getCard().getDescription());
|
||||
|
@ -1157,12 +1165,6 @@ public class StatusListAdapter extends RecyclerView.Adapter implements OnPostAct
|
|||
}else {
|
||||
holder.status_cardview.setVisibility(View.GONE);
|
||||
holder.status_cardview_video.setVisibility(View.GONE);
|
||||
/*if( theme == Helper.THEME_LIGHT)
|
||||
holder.main_container.setBackgroundResource(R.color.mastodonC3__);
|
||||
else if( theme == Helper.THEME_DARK)
|
||||
holder.main_container.setBackgroundResource(R.color.mastodonC1_);
|
||||
else if (theme == Helper.THEME_BLACK)
|
||||
holder.main_container.setBackgroundResource(R.color.black);*/
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2317,6 +2317,14 @@ public class Helper {
|
|||
tableLayout.setTabMode(TabLayout.MODE_SCROLLABLE);
|
||||
}
|
||||
}
|
||||
final SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, android.content.Context.MODE_PRIVATE);
|
||||
final int theme = sharedpreferences.getInt(Helper.SET_THEME, Helper.THEME_DARK);
|
||||
if( theme == THEME_LIGHT)
|
||||
tableLayout.setTabTextColors(ContextCompat.getColor(context, R.color.mastodonC1), ContextCompat.getColor(context, R.color.mastodonC4));
|
||||
else if( theme == THEME_BLACK)
|
||||
tableLayout.setTabTextColors(ContextCompat.getColor(context, R.color.dark_text), ContextCompat.getColor(context, R.color.dark_icon));
|
||||
else if( theme == THEME_DARK)
|
||||
tableLayout.setTabTextColors(ContextCompat.getColor(context, R.color.dark_text), ContextCompat.getColor(context, R.color.mastodonC4));
|
||||
}
|
||||
|
||||
public static void removeTab(TabLayout tableLayout, BaseMainActivity.PagerAdapter pagerAdapter, int position) {
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24.0"
|
||||
android:viewportHeight="24.0">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M7,7h10v3l4,-4 -4,-4v3L5,5v6h2L7,7zM17,17L7,17v-3l-4,4 4,4v-3h12v-6h-2v4z"/>
|
||||
</vector>
|
|
@ -42,7 +42,6 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:background="?attr/colorPrimary"
|
||||
app:layout_scrollFlags="scroll|enterAlways"
|
||||
android:theme="@style/AppThemeDark_NoActionBar"
|
||||
app:popupTheme="?attr/popupOverlay">
|
||||
<ImageView
|
||||
android:id="@+id/iconbar"
|
||||
|
|
|
@ -42,7 +42,6 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:background="?attr/colorPrimary"
|
||||
app:layout_scrollFlags="scroll|enterAlways"
|
||||
android:theme="@style/AppThemeDark_NoActionBar"
|
||||
app:popupTheme="?attr/popupOverlay"/>
|
||||
</android.support.design.widget.AppBarLayout>
|
||||
<RelativeLayout
|
||||
|
|
|
@ -41,7 +41,6 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:background="?attr/colorPrimary"
|
||||
app:layout_scrollFlags="scroll|enterAlways"
|
||||
android:theme="@style/AppThemeDark_NoActionBar"
|
||||
app:popupTheme="?attr/popupOverlay"/>
|
||||
</android.support.design.widget.AppBarLayout>
|
||||
<RelativeLayout
|
||||
|
|
|
@ -42,7 +42,6 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:background="?attr/colorPrimary"
|
||||
app:layout_scrollFlags="scroll|enterAlways"
|
||||
android:theme="@style/AppThemeDark_NoActionBar"
|
||||
app:popupTheme="?attr/popupOverlay">
|
||||
<ImageView
|
||||
android:id="@+id/iconbar"
|
||||
|
|
|
@ -26,7 +26,6 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:background="?attr/colorPrimary"
|
||||
app:layout_scrollFlags="scroll|enterAlways"
|
||||
android:theme="@style/AppThemeDark_NoActionBar"
|
||||
app:popupTheme="?attr/popupOverlay"/>
|
||||
</android.support.design.widget.AppBarLayout>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
|
|
|
@ -26,7 +26,6 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:background="?attr/colorPrimary"
|
||||
app:layout_scrollFlags="scroll|enterAlways"
|
||||
android:theme="@style/AppThemeDark_NoActionBar"
|
||||
app:popupTheme="?attr/popupOverlay"/>
|
||||
</android.support.design.widget.AppBarLayout>
|
||||
<!-- Framelayout to display Fragments -->
|
||||
|
|
|
@ -42,7 +42,6 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:background="?attr/colorPrimary"
|
||||
app:layout_scrollFlags="scroll|enterAlways"
|
||||
android:theme="@style/AppThemeDark_NoActionBar"
|
||||
app:popupTheme="?attr/popupOverlay"/>
|
||||
</android.support.design.widget.AppBarLayout>
|
||||
<RelativeLayout
|
||||
|
|
|
@ -171,12 +171,13 @@
|
|||
android:id="@+id/status_account_displayname"
|
||||
android:maxLines="1"
|
||||
android:drawablePadding="2dp"
|
||||
android:textStyle="bold"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
<TextView
|
||||
android:id="@+id/status_account_displayname_owner"
|
||||
android:visibility="gone"
|
||||
android:maxLines="1"
|
||||
android:textStyle="bold"
|
||||
android:drawablePadding="2dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
|
|
|
@ -140,13 +140,14 @@
|
|||
android:id="@+id/status_account_displayname"
|
||||
android:maxLines="1"
|
||||
android:drawablePadding="2dp"
|
||||
android:textStyle="bold"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
<TextView
|
||||
android:id="@+id/status_account_displayname_owner"
|
||||
android:visibility="gone"
|
||||
android:maxLines="1"
|
||||
android:drawablePadding="2dp"
|
||||
android:textStyle="bold"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
<LinearLayout
|
||||
|
|
|
@ -91,14 +91,15 @@
|
|||
<TextView
|
||||
android:id="@+id/status_account_displayname"
|
||||
android:maxLines="1"
|
||||
android:textStyle="bold"
|
||||
android:drawablePadding="2dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
<TextView
|
||||
android:id="@+id/status_account_displayname_owner"
|
||||
android:visibility="gone"
|
||||
android:maxLines="1"
|
||||
android:drawablePadding="2dp"
|
||||
android:textStyle="bold"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
<TextView
|
||||
|
|
|
@ -11,6 +11,12 @@
|
|||
<color name="header2D">#455A64</color>
|
||||
<color name="header3D">#607D8B</color>
|
||||
|
||||
<color name="dark_text_toot_header">#d9d9d9</color>
|
||||
<color name="dark_link_toot">#0099ff</color>
|
||||
|
||||
<color name="black_text_toot_header">#d9d9d9</color>
|
||||
<color name="black_link_toot">#0099ff</color>
|
||||
|
||||
<color name="dark_text">#f3f3f3</color>
|
||||
<color name="dark_icon">#606984</color>
|
||||
<color name="marked_icon">#ca8f04</color>
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
|
||||
<!-- Customize your theme here. -->
|
||||
<item name="android:textColor">@color/black</item>
|
||||
<item name="colorPrimary">@color/mastodonC1</item>
|
||||
<item name="colorPrimary">@color/white</item>
|
||||
<item name="colorPrimaryDark">@color/mastodonC2</item>
|
||||
<item name="colorAccent">@color/mastodonC4</item>
|
||||
<item name="android:buttonStyle">@style/ButtonColor</item>
|
||||
|
@ -29,15 +29,24 @@
|
|||
<item name="android:itemBackground">@drawable/menu_selector</item>
|
||||
<item name="android:actionModeStyle">@style/ActionMode</item>
|
||||
<item name="android:dropDownListViewStyle">@style/DropDownListViewStyle</item>
|
||||
<item name="actionBarTextColor">@color/mastodonC3__</item>
|
||||
<item name="actionBarTextColor">@color/mastodonC1</item>
|
||||
<item name="color_in_account_header">@color/mastodonC3</item>
|
||||
<item name="colorBackgroundFloating">@color/mastodonC3__</item>
|
||||
<item name="android:colorBackground">@color/mastodonC3__</item>
|
||||
<item name="android:actionBarStyle">@style/LightActionBarTheme</item>
|
||||
</style>
|
||||
|
||||
<style name="LightActionBarTheme" parent="Base.Widget.AppCompat.ActionBar">
|
||||
<item name="android:background">@color/white</item>
|
||||
<item name="titleTextStyle">@style/TextLightActionBarTheme</item>
|
||||
</style>
|
||||
<style name="TextLightActionBarTheme" parent="@style/TextAppearance.AppCompat.Widget.ActionBar.Title">
|
||||
<item name="android:textColor">@color/mastodonC1</item>
|
||||
</style>
|
||||
|
||||
<style name="AppTheme_NoActionBar" parent="Theme.AppCompat.Light.NoActionBar">
|
||||
<item name="android:textColor">@color/black</item>
|
||||
<item name="colorPrimary">@color/mastodonC1</item>
|
||||
<item name="colorPrimary">@color/white</item>
|
||||
<item name="android:scrollbarThumbVertical">@color/transparent</item>
|
||||
<item name="colorPrimaryDark">@color/mastodonC2</item>
|
||||
<item name="colorAccent">@color/mastodonC4</item>
|
||||
|
@ -55,11 +64,12 @@
|
|||
<item name="android:itemBackground">@drawable/menu_selector</item>
|
||||
<item name="android:actionModeStyle">@style/ActionMode</item>
|
||||
<item name="android:dropDownListViewStyle">@style/DropDownListViewStyle</item>
|
||||
<item name="actionBarTextColor">@color/mastodonC3__</item>
|
||||
<item name="actionBarTextColor">@color/mastodonC1</item>
|
||||
<item name="colorButtonNormal">@color/mastodonC4</item>
|
||||
<item name="color_in_account_header">@color/mastodonC3</item>
|
||||
<item name="color_in_account_header">@color/mastodonC2</item>
|
||||
<item name="colorBackgroundFloating">@color/mastodonC3__</item>
|
||||
<item name="android:colorBackground">@color/mastodonC3__</item>
|
||||
<item name="android:actionBarStyle">@style/LightActionBarTheme</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.Transparent" parent="Theme.AppCompat.Light.NoActionBar">
|
||||
|
|
Loading…
Reference in New Issue