|
|
@ -234,6 +234,7 @@ public class StatusDirectMessageAdapter extends RecyclerView.Adapter<RecyclerVie
|
|
|
|
StatusChatViewHolder holder = (StatusChatViewHolder) viewHolder;
|
|
|
|
StatusChatViewHolder holder = (StatusChatViewHolder) viewHolder;
|
|
|
|
Status status = statusList.get(position);
|
|
|
|
Status status = statusList.get(position);
|
|
|
|
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(context);
|
|
|
|
SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(context);
|
|
|
|
|
|
|
|
status.underlined = true;
|
|
|
|
holder.binding.messageContent.setText(
|
|
|
|
holder.binding.messageContent.setText(
|
|
|
|
status.getSpanContent(context,
|
|
|
|
status.getSpanContent(context,
|
|
|
|
new WeakReference<>(holder.binding.messageContent),
|
|
|
|
new WeakReference<>(holder.binding.messageContent),
|
|
|
@ -279,17 +280,19 @@ public class StatusDirectMessageAdapter extends RecyclerView.Adapter<RecyclerVie
|
|
|
|
holder.binding.mainContainer.setBackgroundResource(R.drawable.bubble_right_tail);
|
|
|
|
holder.binding.mainContainer.setBackgroundResource(R.drawable.bubble_right_tail);
|
|
|
|
|
|
|
|
|
|
|
|
layoutParams.setMargins((int) Helper.convertDpToPixel(50, context), (int) Helper.convertDpToPixel(12, context), 0, 0);
|
|
|
|
layoutParams.setMargins((int) Helper.convertDpToPixel(50, context), (int) Helper.convertDpToPixel(12, context), 0, 0);
|
|
|
|
|
|
|
|
holder.binding.date.setTextColor(ThemeHelper.getAttColor(context, R.attr.colorOnPrimary));
|
|
|
|
|
|
|
|
holder.binding.messageContent.setTextColor(ThemeHelper.getAttColor(context, R.attr.colorOnPrimary));
|
|
|
|
|
|
|
|
holder.binding.userName.setTextColor(ThemeHelper.getAttColor(context, R.attr.colorOnPrimary));
|
|
|
|
|
|
|
|
holder.binding.messageContent.setLinkTextColor(ThemeHelper.getAttColor(context, R.attr.colorOnPrimary));
|
|
|
|
|
|
|
|
Helper.changeDrawableColor(context, holder.binding.visibility, ThemeHelper.getAttColor(context, R.attr.colorOnPrimary));
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
holder.binding.mainContainer.setBackgroundResource(R.drawable.bubble_left_tail);
|
|
|
|
|
|
|
|
layoutParams.setMargins(0, (int) Helper.convertDpToPixel(12, context), (int) Helper.convertDpToPixel(50, context), 0);
|
|
|
|
holder.binding.date.setTextColor(ThemeHelper.getAttColor(context, R.attr.colorOnSecondary));
|
|
|
|
holder.binding.date.setTextColor(ThemeHelper.getAttColor(context, R.attr.colorOnSecondary));
|
|
|
|
holder.binding.messageContent.setTextColor(ThemeHelper.getAttColor(context, R.attr.colorOnSecondary));
|
|
|
|
holder.binding.messageContent.setTextColor(ThemeHelper.getAttColor(context, R.attr.colorOnSecondary));
|
|
|
|
holder.binding.userName.setTextColor(ThemeHelper.getAttColor(context, R.attr.colorOnSecondary));
|
|
|
|
holder.binding.userName.setTextColor(ThemeHelper.getAttColor(context, R.attr.colorOnSecondary));
|
|
|
|
|
|
|
|
holder.binding.messageContent.setLinkTextColor(ThemeHelper.getAttColor(context, R.attr.colorOnSecondary));
|
|
|
|
Helper.changeDrawableColor(context, holder.binding.visibility, ThemeHelper.getAttColor(context, R.attr.colorOnSecondary));
|
|
|
|
Helper.changeDrawableColor(context, holder.binding.visibility, ThemeHelper.getAttColor(context, R.attr.colorOnSecondary));
|
|
|
|
} else {
|
|
|
|
|
|
|
|
holder.binding.mainContainer.setBackgroundResource(R.drawable.bubble_left_tail);
|
|
|
|
|
|
|
|
layoutParams.setMargins(0, (int) Helper.convertDpToPixel(12, context), (int) Helper.convertDpToPixel(50, context), 0);
|
|
|
|
|
|
|
|
holder.binding.date.setTextColor(ContextCompat.getColor(context, R.color.black));
|
|
|
|
|
|
|
|
holder.binding.messageContent.setTextColor(ContextCompat.getColor(context, R.color.black));
|
|
|
|
|
|
|
|
holder.binding.userName.setTextColor(ContextCompat.getColor(context, R.color.black));
|
|
|
|
|
|
|
|
Helper.changeDrawableColor(context, holder.binding.visibility, R.color.black);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
holder.binding.mainContainer.setLayoutParams(layoutParams);
|
|
|
|
holder.binding.mainContainer.setLayoutParams(layoutParams);
|
|
|
|
|
|
|
|
|
|
|
@ -333,9 +336,13 @@ public class StatusDirectMessageAdapter extends RecyclerView.Adapter<RecyclerVie
|
|
|
|
|
|
|
|
|
|
|
|
final float scale = sharedpreferences.getFloat(context.getString(R.string.SET_FONT_SCALE), 1.1f);
|
|
|
|
final float scale = sharedpreferences.getFloat(context.getString(R.string.SET_FONT_SCALE), 1.1f);
|
|
|
|
if (status.poll != null && status.poll.options != null) {
|
|
|
|
if (status.poll != null && status.poll.options != null) {
|
|
|
|
|
|
|
|
if (status.account.id.equals(MainActivity.currentUserID)) {
|
|
|
|
|
|
|
|
holder.binding.poll.pollInfo.setTextColor(ThemeHelper.getAttColor(context, R.attr.colorOnPrimary));
|
|
|
|
|
|
|
|
holder.binding.poll.refresh.setTextColor(ThemeHelper.getAttColor(context, R.attr.colorOnPrimary));
|
|
|
|
|
|
|
|
} else {
|
|
|
|
holder.binding.poll.pollInfo.setTextColor(ThemeHelper.getAttColor(context, R.attr.colorOnSecondary));
|
|
|
|
holder.binding.poll.pollInfo.setTextColor(ThemeHelper.getAttColor(context, R.attr.colorOnSecondary));
|
|
|
|
holder.binding.poll.refresh.setTextColor(ThemeHelper.getAttColor(context, R.attr.colorOnSecondary));
|
|
|
|
holder.binding.poll.refresh.setTextColor(ThemeHelper.getAttColor(context, R.attr.colorOnSecondary));
|
|
|
|
|
|
|
|
}
|
|
|
|
StatusesVM statusesVM = new ViewModelProvider((ViewModelStoreOwner) context).get(StatusesVM.class);
|
|
|
|
StatusesVM statusesVM = new ViewModelProvider((ViewModelStoreOwner) context).get(StatusesVM.class);
|
|
|
|
if (status.poll.voted || status.poll.expired) {
|
|
|
|
if (status.poll.voted || status.poll.expired) {
|
|
|
|
holder.binding.poll.submitVote.setVisibility(View.GONE);
|
|
|
|
holder.binding.poll.submitVote.setVisibility(View.GONE);
|
|
|
@ -362,8 +369,13 @@ public class StatusDirectMessageAdapter extends RecyclerView.Adapter<RecyclerVie
|
|
|
|
pollItem.getSpanTitle(context, status,
|
|
|
|
pollItem.getSpanTitle(context, status,
|
|
|
|
new WeakReference<>(pollItemBinding.pollItemText)),
|
|
|
|
new WeakReference<>(pollItemBinding.pollItemText)),
|
|
|
|
TextView.BufferType.SPANNABLE);
|
|
|
|
TextView.BufferType.SPANNABLE);
|
|
|
|
|
|
|
|
if (status.account.id.equals(MainActivity.currentUserID)) {
|
|
|
|
|
|
|
|
pollItemBinding.pollItemPercent.setTextColor(ThemeHelper.getAttColor(context, R.attr.colorOnPrimary));
|
|
|
|
|
|
|
|
pollItemBinding.pollItemText.setTextColor(ThemeHelper.getAttColor(context, R.attr.colorOnPrimary));
|
|
|
|
|
|
|
|
} else {
|
|
|
|
pollItemBinding.pollItemPercent.setTextColor(ThemeHelper.getAttColor(context, R.attr.colorOnSecondary));
|
|
|
|
pollItemBinding.pollItemPercent.setTextColor(ThemeHelper.getAttColor(context, R.attr.colorOnSecondary));
|
|
|
|
pollItemBinding.pollItemText.setTextColor(ThemeHelper.getAttColor(context, R.attr.colorOnSecondary));
|
|
|
|
pollItemBinding.pollItemText.setTextColor(ThemeHelper.getAttColor(context, R.attr.colorOnSecondary));
|
|
|
|
|
|
|
|
}
|
|
|
|
pollItemBinding.pollItemValue.setProgress((int) value);
|
|
|
|
pollItemBinding.pollItemValue.setProgress((int) value);
|
|
|
|
if (pollItem.votes_count == greaterValue) {
|
|
|
|
if (pollItem.votes_count == greaterValue) {
|
|
|
|
pollItemBinding.pollItemPercent.setTypeface(null, Typeface.BOLD);
|
|
|
|
pollItemBinding.pollItemPercent.setTypeface(null, Typeface.BOLD);
|
|
|
@ -395,8 +407,13 @@ public class StatusDirectMessageAdapter extends RecyclerView.Adapter<RecyclerVie
|
|
|
|
new WeakReference<>(cb)),
|
|
|
|
new WeakReference<>(cb)),
|
|
|
|
TextView.BufferType.SPANNABLE);
|
|
|
|
TextView.BufferType.SPANNABLE);
|
|
|
|
holder.binding.poll.multipleChoice.addView(cb);
|
|
|
|
holder.binding.poll.multipleChoice.addView(cb);
|
|
|
|
|
|
|
|
if (status.account.id.equals(MainActivity.currentUserID)) {
|
|
|
|
|
|
|
|
cb.setTextColor(ThemeHelper.getAttColor(context, R.attr.colorOnPrimary));
|
|
|
|
|
|
|
|
} else {
|
|
|
|
cb.setTextColor(ThemeHelper.getAttColor(context, R.attr.colorOnSecondary));
|
|
|
|
cb.setTextColor(ThemeHelper.getAttColor(context, R.attr.colorOnSecondary));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
holder.binding.poll.multipleChoice.setVisibility(View.VISIBLE);
|
|
|
|
holder.binding.poll.multipleChoice.setVisibility(View.VISIBLE);
|
|
|
|
holder.binding.poll.singleChoiceRadioGroup.setVisibility(View.GONE);
|
|
|
|
holder.binding.poll.singleChoiceRadioGroup.setVisibility(View.GONE);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
@ -408,7 +425,12 @@ public class StatusDirectMessageAdapter extends RecyclerView.Adapter<RecyclerVie
|
|
|
|
pollOption.getSpanTitle(context, status,
|
|
|
|
pollOption.getSpanTitle(context, status,
|
|
|
|
new WeakReference<>(rb)),
|
|
|
|
new WeakReference<>(rb)),
|
|
|
|
TextView.BufferType.SPANNABLE);
|
|
|
|
TextView.BufferType.SPANNABLE);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (status.account.id.equals(MainActivity.currentUserID)) {
|
|
|
|
|
|
|
|
rb.setTextColor(ThemeHelper.getAttColor(context, R.attr.colorOnPrimary));
|
|
|
|
|
|
|
|
} else {
|
|
|
|
rb.setTextColor(ThemeHelper.getAttColor(context, R.attr.colorOnSecondary));
|
|
|
|
rb.setTextColor(ThemeHelper.getAttColor(context, R.attr.colorOnSecondary));
|
|
|
|
|
|
|
|
}
|
|
|
|
holder.binding.poll.singleChoiceRadioGroup.addView(rb);
|
|
|
|
holder.binding.poll.singleChoiceRadioGroup.addView(rb);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
holder.binding.poll.singleChoiceRadioGroup.setVisibility(View.VISIBLE);
|
|
|
|
holder.binding.poll.singleChoiceRadioGroup.setVisibility(View.VISIBLE);
|
|
|
|