@ -5,9 +5,10 @@ import java.util.List;
import org.androidannotations.annotations.EBean ;
import org.androidannotations.annotations.EBean ;
import org.androidannotations.annotations.RootContext ;
import org.androidannotations.annotations.RootContext ;
import org.transdroid.core.R ;
import org.transdroid.core.R ;
import org.transdroid.core.gui.lists.SimpleListItem ;
import org.transdroid.core.app.settings.ServerSetting ;
import org.transdroid.core.gui.lists.SimpleListItemAdapter ;
import org.transdroid.core.gui.lists.SimpleListItemAdapter ;
import org.transdroid.core.gui.navigation.NavigationSelectionView.NavigationFilterManager ;
import org.transdroid.core.gui.navigation.NavigationSelectionView.NavigationFilterManager ;
import org.transdroid.core.gui.navigation.StatusType.StatusTypeFilter ;
import android.content.Context ;
import android.content.Context ;
import android.view.View ;
import android.view.View ;
@ -46,10 +47,10 @@ public class FilterListAdapter extends MergeAdapter {
* Update the list of available servers
* Update the list of available servers
* @param servers The new list of available servers
* @param servers The new list of available servers
* /
* /
public void updateServers ( List < ? extends SimpleListItem > servers ) {
public void updateServers ( List < ServerSetting > servers ) {
if ( this . serverItems = = null & & servers ! = null ) {
if ( this . serverItems = = null & & servers ! = null ) {
serverSeparator = FilterSeparatorView_ . build ( context ) . setText ( context . getString ( R . string . navigation_servers ) ) ;
serverSeparator = FilterSeparatorView_ . build ( context ) . setText ( context . getString ( R . string . navigation_servers ) ) ;
serverSeparator . setVisibility ( serverItem s . isEmpty ( ) ? View . GONE : View . VISIBLE ) ;
serverSeparator . setVisibility ( servers . isEmpty ( ) ? View . GONE : View . VISIBLE ) ;
addView ( serverSeparator , false ) ;
addView ( serverSeparator , false ) ;
this . serverItems = new SimpleListItemAdapter ( context , servers ) ;
this . serverItems = new SimpleListItemAdapter ( context , servers ) ;
addAdapter ( serverItems ) ;
addAdapter ( serverItems ) ;
@ -66,11 +67,11 @@ public class FilterListAdapter extends MergeAdapter {
* Update the list of available status types
* Update the list of available status types
* @param statusTypes The new list of available status types
* @param statusTypes The new list of available status types
* /
* /
public void updateStatusTypes ( List < ? extends SimpleListItem > statusTypes ) {
public void updateStatusTypes ( List < StatusTypeFilter > statusTypes ) {
if ( this . statusTypeItems = = null & & statusTypes ! = null ) {
if ( this . statusTypeItems = = null & & statusTypes ! = null ) {
statusTypeSeparator = FilterSeparatorView_ . build ( context ) . setText (
statusTypeSeparator = FilterSeparatorView_ . build ( context ) . setText (
context . getString ( R . string . navigation_status ) ) ;
context . getString ( R . string . navigation_status ) ) ;
statusTypeSeparator . setVisibility ( statusTypeItem s . isEmpty ( ) ? View . GONE : View . VISIBLE ) ;
statusTypeSeparator . setVisibility ( statusTypes . isEmpty ( ) ? View . GONE : View . VISIBLE ) ;
addView ( statusTypeSeparator , false ) ;
addView ( statusTypeSeparator , false ) ;
this . statusTypeItems = new SimpleListItemAdapter ( context , statusTypes ) ;
this . statusTypeItems = new SimpleListItemAdapter ( context , statusTypes ) ;
addAdapter ( statusTypeItems ) ;
addAdapter ( statusTypeItems ) ;
@ -87,14 +88,14 @@ public class FilterListAdapter extends MergeAdapter {
* Update the list of available labels
* Update the list of available labels
* @param labels The new list of available labels
* @param labels The new list of available labels
* /
* /
public void updateLabels ( List < ? extends SimpleListItem > labels ) {
public void updateLabels ( List < Label > labels ) {
if ( this . labelItems = = null & & labels ! = null ) {
if ( this . labelItems = = null & & labels ! = null ) {
labelSeperator = FilterSeparatorView_ . build ( context ) . setText ( context . getString ( R . string . navigation_labels ) ) ;
labelSeperator = FilterSeparatorView_ . build ( context ) . setText ( context . getString ( R . string . navigation_labels ) ) ;
labelSeperator . setVisibility ( labelItem s . isEmpty ( ) ? View . GONE : View . VISIBLE ) ;
labelSeperator . setVisibility ( labels . isEmpty ( ) ? View . GONE : View . VISIBLE ) ;
addView ( labelSeperator , false ) ;
addView ( labelSeperator , false ) ;
this . labelItems = new SimpleListItemAdapter ( context , labels ) ;
this . labelItems = new SimpleListItemAdapter ( context , labels ) ;
addAdapter ( labelItems ) ;
addAdapter ( labelItems ) ;
} else if ( this . server Items ! = null & & labels ! = null ) {
} else if ( this . label Items ! = null & & labels ! = null ) {
labelSeperator . setVisibility ( labelItems . isEmpty ( ) ? View . GONE : View . VISIBLE ) ;
labelSeperator . setVisibility ( labelItems . isEmpty ( ) ? View . GONE : View . VISIBLE ) ;
this . labelItems . update ( labels ) ;
this . labelItems . update ( labels ) ;
} else {
} else {