mirror of
				https://github.com/bspeice/UNCCGameDay
				synced 2025-11-04 02:10:35 -05:00 
			
		
		
		
	RSVP List showing - Ordered by last name >AGK
RSVP list showing on search page. Ordered properly by last name. Still need to implement Search function - will tackle later today. All Section numbers showing NULL, all row numbers showing 0. Probably a quick fix on Bradlee's part.
This commit is contained in:
		@ -1,5 +1,7 @@
 | 
			
		||||
package com.uncc.gameday.activities;
 | 
			
		||||
 | 
			
		||||
import java.util.Collections;
 | 
			
		||||
import java.util.Comparator;
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
import retrofit.RetrofitError;
 | 
			
		||||
@ -7,8 +9,9 @@ import retrofit.RetrofitError;
 | 
			
		||||
import android.content.Context;
 | 
			
		||||
import android.os.Bundle;
 | 
			
		||||
import android.util.Log;
 | 
			
		||||
import android.widget.ArrayAdapter;
 | 
			
		||||
import android.widget.ListView;
 | 
			
		||||
import android.widget.Toast;
 | 
			
		||||
 | 
			
		||||
import com.uncc.gameday.R;
 | 
			
		||||
import com.uncc.gameday.registration.Attendee;
 | 
			
		||||
import com.uncc.gameday.registration.RegistrationClient;
 | 
			
		||||
@ -40,7 +43,27 @@ public class Search extends MenuActivity {
 | 
			
		||||
				Toast.makeText(c, R.string.internet_down_error, Toast.LENGTH_SHORT).show();
 | 
			
		||||
				Log.e("Search", e.getLocalizedMessage());
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
			
 | 
			
		||||
			//sorts RSVPList alphabetically by last name
 | 
			
		||||
        	Collections.sort(rsvpList, new Comparator<Attendee>() {
 | 
			
		||||
        		@Override
 | 
			
		||||
        		public int compare(Attendee a1, Attendee a2) {
 | 
			
		||||
        			String compareName = a1.getLastName();
 | 
			
		||||
        			String thisName = a2.getLastName();
 | 
			
		||||
        			return compareName.compareTo(thisName);
 | 
			
		||||
        		}			
 | 
			
		||||
        	});
 | 
			
		||||
 | 
			
		||||
        	//function to display RSVPList onto listView
 | 
			
		||||
			runOnUiThread(new Runnable() {
 | 
			
		||||
				@Override
 | 
			
		||||
				public void run() {
 | 
			
		||||
					ListView listView = (ListView)findViewById(R.id.RSVPListView);
 | 
			
		||||
				    ArrayAdapter<Attendee> adapter =
 | 
			
		||||
				            new ArrayAdapter<Attendee>(c,android.R.layout.simple_list_item_1, rsvpList);
 | 
			
		||||
				    listView.setAdapter(adapter);	
 | 
			
		||||
				}
 | 
			
		||||
			});		
 | 
			
		||||
	}	
 | 
			
		||||
}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -112,4 +112,8 @@ public class Attendee {
 | 
			
		||||
	public void setId(int id) {
 | 
			
		||||
		this.id = id;
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
    public String toString() {
 | 
			
		||||
        return this.getFirstName() + " " + this.getLastName() + ": Section " + getSection() + ", Row " + getRow();
 | 
			
		||||
}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user