mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-20 20:19:42 +01:00
Fix some bugs + coloring
Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
parent
d7467b4fb6
commit
c1c536496c
@ -86,7 +86,6 @@ public class MagicIncomingTextMessageViewHolder
|
|||||||
if (individualHashMap.get("type").equals("user")) {
|
if (individualHashMap.get("type").equals("user")) {
|
||||||
int color;
|
int color;
|
||||||
|
|
||||||
if (!individualHashMap.get("id").equals(message.getActorId())) {
|
|
||||||
if (individualHashMap.get("id").equals(currentUser.getUserId())) {
|
if (individualHashMap.get("id").equals(currentUser.getUserId())) {
|
||||||
color = NextcloudTalkApplication.getSharedApplication().getResources().getColor(R.color
|
color = NextcloudTalkApplication.getSharedApplication().getResources().getColor(R.color
|
||||||
.nc_incoming_text_mention_you);
|
.nc_incoming_text_mention_you);
|
||||||
@ -99,7 +98,6 @@ public class MagicIncomingTextMessageViewHolder
|
|||||||
messageString, "@" + individualHashMap.get("name"), color);
|
messageString, "@" + individualHashMap.get("name"), color);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -60,7 +60,6 @@ public class MentionAutocompletePresenter extends RecyclerViewPresenter<Mention>
|
|||||||
private Context context;
|
private Context context;
|
||||||
|
|
||||||
private String roomToken;
|
private String roomToken;
|
||||||
private List<AbstractFlexibleItem> userItemList = new ArrayList<>();
|
|
||||||
|
|
||||||
public MentionAutocompletePresenter(Context context) {
|
public MentionAutocompletePresenter(Context context) {
|
||||||
super(context);
|
super(context);
|
||||||
@ -77,7 +76,7 @@ public class MentionAutocompletePresenter extends RecyclerViewPresenter<Mention>
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected RecyclerView.Adapter instantiateAdapter() {
|
protected RecyclerView.Adapter instantiateAdapter() {
|
||||||
adapter = new FlexibleAdapter<>(userItemList, context, true);
|
adapter = new FlexibleAdapter<>(new ArrayList<AbstractFlexibleItem>(), context, true);
|
||||||
adapter.addListener(this);
|
adapter.addListener(this);
|
||||||
return adapter;
|
return adapter;
|
||||||
}
|
}
|
||||||
@ -105,21 +104,18 @@ public class MentionAutocompletePresenter extends RecyclerViewPresenter<Mention>
|
|||||||
List<AbstractFlexibleItem> internalUserItemList = new ArrayList<>();
|
List<AbstractFlexibleItem> internalUserItemList = new ArrayList<>();
|
||||||
if (mentionsList.size() == 0 ||
|
if (mentionsList.size() == 0 ||
|
||||||
(mentionsList.size() == 1 && mentionsList.get(0).getId().equals(query.toString()))) {
|
(mentionsList.size() == 1 && mentionsList.get(0).getId().equals(query.toString()))) {
|
||||||
userItemList = new ArrayList<>();
|
|
||||||
adapter.notifyDataSetChanged();
|
adapter.notifyDataSetChanged();
|
||||||
} else {
|
} else {
|
||||||
for (Mention mention : mentionsList) {
|
for (Mention mention : mentionsList) {
|
||||||
internalUserItemList.add(new MentionAutocompleteItem(mention.getId(), mention
|
internalUserItemList.add(new MentionAutocompleteItem(mention.getId(), mention
|
||||||
.getLabel(), currentUser));
|
.getLabel(), currentUser));
|
||||||
}
|
}
|
||||||
userItemList = internalUserItemList;
|
|
||||||
adapter.updateDataSet(internalUserItemList, true);
|
adapter.updateDataSet(internalUserItemList, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(Throwable e) {
|
public void onError(Throwable e) {
|
||||||
userItemList = new ArrayList<>();
|
|
||||||
adapter.updateDataSet(new ArrayList<>(), false);
|
adapter.updateDataSet(new ArrayList<>(), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -129,7 +125,6 @@ public class MentionAutocompletePresenter extends RecyclerViewPresenter<Mention>
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
userItemList = new ArrayList<>();
|
|
||||||
adapter.updateDataSet(new ArrayList<>(), false);
|
adapter.updateDataSet(new ArrayList<>(), false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -137,11 +132,13 @@ public class MentionAutocompletePresenter extends RecyclerViewPresenter<Mention>
|
|||||||
@Override
|
@Override
|
||||||
public boolean onItemClick(View view, int position) {
|
public boolean onItemClick(View view, int position) {
|
||||||
Mention mention = new Mention();
|
Mention mention = new Mention();
|
||||||
MentionAutocompleteItem mentionAutocompleteItem = (MentionAutocompleteItem) userItemList.get(position);
|
MentionAutocompleteItem mentionAutocompleteItem = (MentionAutocompleteItem) adapter.getItem(position);
|
||||||
|
if (mentionAutocompleteItem != null) {
|
||||||
mention.setId(mentionAutocompleteItem.getUserId());
|
mention.setId(mentionAutocompleteItem.getUserId());
|
||||||
mention.setLabel(mentionAutocompleteItem.getDisplayName());
|
mention.setLabel(mentionAutocompleteItem.getDisplayName());
|
||||||
mention.setSource("users");
|
mention.setSource("users");
|
||||||
dispatchClick(mention);
|
dispatchClick(mention);
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -40,7 +40,9 @@
|
|||||||
app:outcomingTextSize="@dimen/chat_text_size"
|
app:outcomingTextSize="@dimen/chat_text_size"
|
||||||
app:outcomingTimeTextSize="12sp"
|
app:outcomingTimeTextSize="12sp"
|
||||||
app:outcomingTextColor="@color/nc_outcoming_text_default"
|
app:outcomingTextColor="@color/nc_outcoming_text_default"
|
||||||
|
app:outcomingTextLinkColor="@color/nc_outcoming_text_default"
|
||||||
app:incomingTextColor="@color/nc_incoming_text_default"
|
app:incomingTextColor="@color/nc_incoming_text_default"
|
||||||
|
app:incomingTextLinkColor="@color/nc_incoming_text_default"
|
||||||
app:textAutoLink="all"/>
|
app:textAutoLink="all"/>
|
||||||
|
|
||||||
<View
|
<View
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
<color name="secondaryColorAccent">#7CC4E6</color>
|
<color name="secondaryColorAccent">#7CC4E6</color>
|
||||||
<color name="nc_outcoming_text_default">#99DBFF</color>
|
<color name="nc_outcoming_text_default">#99DBFF</color>
|
||||||
<color name="nc_outcoming_text_mention_others">@color/white</color>
|
<color name="nc_outcoming_text_mention_others">@color/white</color>
|
||||||
<color name="nc_incoming_text_default">#27292B</color>
|
<color name="nc_incoming_text_default">#37505D</color>
|
||||||
<color name="nc_incoming_text_mention_you">#C98879</color>
|
<color name="nc_incoming_text_mention_you">#C98879</color>
|
||||||
<color name="nc_incoming_text_mention_others">#1D1F20</color>
|
<color name="nc_incoming_text_mention_others">#37505D</color>
|
||||||
|
|
||||||
<color name="nc_darkRed">#D32F2F</color>
|
<color name="nc_darkRed">#D32F2F</color>
|
||||||
<color name="nc_darkGreen">#006400</color>
|
<color name="nc_darkGreen">#006400</color>
|
||||||
|
Loading…
Reference in New Issue
Block a user