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:
agk512 2013-12-05 13:37:01 -05:00
parent a728025eed
commit f6b7609420
4 changed files with 41 additions and 13 deletions

View File

@ -27,6 +27,10 @@
android:name="com.uncc.gameday.activities.Registration" android:name="com.uncc.gameday.activities.Registration"
android:label="@string/title_activity_registration" > android:label="@string/title_activity_registration" >
</activity> </activity>
<activity
android:name="com.uncc.gameday.activities.Search"
android:label="@string/title_activity_search_rsvp" >
</activity>
<activity <activity
android:name="com.uncc.gameday.activities.Home" android:name="com.uncc.gameday.activities.Home"
android:label="@string/app_name" > android:label="@string/app_name" >

View File

@ -23,16 +23,13 @@
android:inputType="text" > android:inputType="text" >
</SearchView> </SearchView>
<TextView <ListView
android:id="@+id/textView1" android:id="@+id/RSVPListView"
android:layout_width="wrap_content" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/searchView1" android:layout_alignLeft="@+id/searchView1"
android:layout_centerHorizontal="true" android:layout_below="@+id/searchView1" >
android:layout_marginTop="60dp"
android:text="@string/search_text" </ListView>
android:textColor="@color/black"
android:textStyle="italic"
android:textAppearance="?android:attr/textAppearanceLarge" />
</RelativeLayout> </RelativeLayout>

View File

@ -1,5 +1,7 @@
package com.uncc.gameday.activities; package com.uncc.gameday.activities;
import java.util.Collections;
import java.util.Comparator;
import java.util.List; import java.util.List;
import retrofit.RetrofitError; import retrofit.RetrofitError;
@ -7,8 +9,9 @@ import retrofit.RetrofitError;
import android.content.Context; import android.content.Context;
import android.os.Bundle; import android.os.Bundle;
import android.util.Log; import android.util.Log;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.Toast; import android.widget.Toast;
import com.uncc.gameday.R; import com.uncc.gameday.R;
import com.uncc.gameday.registration.Attendee; import com.uncc.gameday.registration.Attendee;
import com.uncc.gameday.registration.RegistrationClient; 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(); Toast.makeText(c, R.string.internet_down_error, Toast.LENGTH_SHORT).show();
Log.e("Search", e.getLocalizedMessage()); 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);
}
});
}
}
} }

View File

@ -112,4 +112,8 @@ public class Attendee {
public void setId(int id) { public void setId(int id) {
this.id = id; this.id = id;
} }
public String toString() {
return this.getFirstName() + " " + this.getLastName() + ": Section " + getSection() + ", Row " + getRow();
}
} }