2

我正在尝试建立一个具有与FacebookInstagramnetworking application相同的提要发布功能的社交。

这包括标记朋友和添加哈希标记。我已经实现了使用 标记朋友的功能MultiAutoCompleteTextView。它的工作方式如下:

1)当我输入@时,它会填充我的朋友列表。

2)当我点击任何特定的朋友时,它会被添加到提要描述区域中。

但问题是,假设我在我的帖子中标记了一个朋友,然后他不会再出现在MultiAutoCompleteTextView下拉列表中,这样一个朋友就可以被标记一次。

假设我已经从描述中删除了那个标记的朋友,那么只有它会在MultiAutoCompleteTextView下拉列表中再次可见。

任何帮助将不胜感激。

4

2 回答 2

0

当您键入 @ 时,ListView All 会自动填充。为此,使用自定义自动完成 TextView

于 2018-06-06T09:46:10.153 回答
0

First of all where is the user-list source coming from? If the source coming from your own server you could easily sending the userID to the server to tell your database to not query specific userID. This approach is very good in the case if you using LIMIT, if your user try to tag all the people with starting name John then if your record return only 15 record once your user will not getting any data.

Second method will be just using a ArrayList<> to store the user which you already click. Then you could check something like this

if(!arrayList.contains("key")){
    result.add("key");
}

Which arrayList is where you store your value of user. If it doesn't contain in that arrayList mean it doesn't selected by the user just go ahead add it into your array. It is just suggestion you need to think how to integrate to your app.

Here is the thing you could mention repeatly with same user in instagram or facebook. If it doesn't contain in the drop down list your user still can typing in the same character to mention that user again so if you worry about notification or something it is better to check for that as well. social application is very hard took me year to built a good one.

于 2017-01-23T07:03:15.173 回答