public static ActionButtonFragment WithAction (string text, int buttonDrawableId)
		{
			var r = new ActionButtonFragment ();
			r.text = text;
			r.buttonDrawableId = buttonDrawableId;
			return r;
		}
 public static ActionButtonFragment WithAction(string text, int buttonDrawableId, Action callback = null)
 {
     var r = new ActionButtonFragment ();
     r.text = text;
     r.buttonDrawableId = buttonDrawableId;
     r.callback = callback;
     return r;
 }
        public static ActionButtonFragment WithAction(string text, int buttonDrawableId)
        {
            var r = new ActionButtonFragment();

            r.text             = text;
            r.buttonDrawableId = buttonDrawableId;
            return(r);
        }
Exemple #4
0
        public static ActionButtonFragment WithAction(string text, int buttonDrawableId, Action callback = null)
        {
            var r = new ActionButtonFragment();

            r.text             = text;
            r.buttonDrawableId = buttonDrawableId;
            r.callback         = callback;
            return(r);
        }
 public static ActionButtonFragment WithToggleAction(Tuple<string, string> texts, int buttonDrawableId, bool initialState, Action<bool> callback = null)
 {
     var r = new ActionButtonFragment ();
     r.texts = texts;
     r.buttonDrawableId = buttonDrawableId;
     r.toggleCallback = callback;
     r.initialState = initialState;
     return r;
 }
Exemple #6
0
        public static ActionButtonFragment WithToggleAction(Tuple <string, string> texts, int buttonDrawableId, bool initialState, Action <bool> callback = null)
        {
            var r = new ActionButtonFragment();

            r.texts            = texts;
            r.buttonDrawableId = buttonDrawableId;
            r.toggleCallback   = callback;
            r.initialState     = initialState;
            return(r);
        }
        public override Fragment GetFragment(int row, int column)
        {
            if (column == 1)
            {
                return(ActionButtonFragment.WithAction("Navigate", Resource.Drawable.navigate_button));
            }
            if (column == 2)
            {
                return(ActionButtonFragment.WithAction("Add to Favorite", Resource.Drawable.favorite_button));
            }

            return(StationCardFragment.WithStation(stations [row], currentLocation, status));
        }
Exemple #8
0
        public override Fragment GetFragment(int row, int column)
        {
            var station = stations [row];
            var id      = station.Id;

            if (column == 1)
            {
                return(ActionButtonFragment.WithAction("Navigate", Resource.Drawable.navigate_button,
                                                       () => actions.NavigateToStation(id)));
            }
            if (column == 2)
            {
                return(ActionButtonFragment.WithToggleAction(Tuple.Create("Favorite", "Unfavorite"),
                                                             Resource.Drawable.favorite_button,
                                                             station.IsFavorite,
                                                             cked => actions.ToggleFavoriteStation(id, cked)));
            }

            return(stationFragments [row] ??
                   (stationFragments [row] = StationCardFragment.WithStation(station, actions.CurrentStatus)));
        }