Skip to content

Commit

Permalink
Merge pull request #35 from teamOSC/people
Browse files Browse the repository at this point in the history
Same interests Finally resolved with proper search
  • Loading branch information
laavanyebahl committed Apr 30, 2015
2 parents afb3323 + 3fd6c04 commit 8a846cd
Showing 1 changed file with 14 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import android.widget.AdapterView;
import android.widget.EditText;
import android.widget.ListView;
import android.widget.Toast;

import com.parse.FindCallback;
import com.parse.GetCallback;
Expand Down Expand Up @@ -46,6 +47,8 @@ public class PeopleSameInterestsFragment extends PeopleListFragment {
EditText search;
ParseUser User = ParseUser.getCurrentUser();

HashMap<String,String> existingElement = new HashMap<>();

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
Expand Down Expand Up @@ -218,6 +221,9 @@ public void done(final ParseUser user, ParseException e) {

public void doneFetchingUserInterests(ArrayList<ParseObject> currentUserInterestsList) {


existingElement.clear();

if (currentUserInterestsList != null && !currentUserInterestsList.isEmpty())

{
Expand Down Expand Up @@ -252,20 +258,19 @@ public void done(final List<ParseUser> objects, ParseException e) {


public void doneFetchingPeople(List<ParseUser> objects) {
listOfPeople.clear();

HashMap<String,String> existingElement = new HashMap<>();

existingElement.clear();

for (ParseUser pu : objects) {
//access the data associated with the ParseUser using the get method
//pu.getString("key") or pu.get("key")

String name = pu.getUsername();

if (!pu.getUsername().equals(currentuser) && pu.getBoolean(ParseTables.Users.FULLY_REGISTERED)) {
if (!existingElement.containsKey(pu.getUsername())) {
if (!existingElement.containsKey(name)) {

each = new EachRow3();
EachRow3 each = new EachRow3();
each.cname = pu.getString(ParseTables.Users.NAME);


Expand Down Expand Up @@ -318,7 +323,7 @@ public void doneFetchingPeople(List<ParseUser> objects) {


listOfPeople.add(each);
existingElement.put(pu.getUsername(),"true");
existingElement.put(name,name);
}
}
}
Expand Down Expand Up @@ -388,6 +393,9 @@ public void done(final ParseUser user, ParseException e) {

public void doneFetchingUserInterestsForSearch(ArrayList<ParseObject> currentUserInterestsList, String textSearch) {

existingElement.clear();


if (!currentUserInterestsList.isEmpty())

{
Expand Down

0 comments on commit 8a846cd

Please sign in to comment.