Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Add support to addItem and removeItem to DashboardView #87

Closed
wants to merge 1 commit into from

3 participants

Ruben Fonseca Neeraj Gupta Marshall Culpepper
Ruben Fonseca

I was building a project and needed to manually add and remove items to the DashboardView.

I realize that it was easy to change the API so here's my first pull request.

Neeraj Gupta
Owner

Signed CLA is in place.

Ruben - Thanks for your pull request. Please create a JIRA ticket with a test case and we will process the pull request.

Marshall Culpepper

@rubenfonseca it looks like we will also need you to merge this with our latest master :)

Ruben Fonseca

Hi guys I already had deleted my local branch because I did give up on this pull request (11 months ago? really?).

I had to create a new branch and a new pull request that can be found here #1481

Neeraj Gupta
Owner

@rubenfonseca - Thanks for the updated pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Apr 08, 2011
Ruben Fonseca rubenfonseca Add addItem and removeItem methods to DashboardView c29bda2
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 18 additions and 0 deletions. Show diff stats Hide diff stats

  1. +18 0 iphone/Classes/TiUIDashboardViewProxy.m
18 iphone/Classes/TiUIDashboardViewProxy.m
@@ -8,6 +8,7 @@
8 8
9 9 #import "TiUIDashboardViewProxy.h"
10 10 #import "TiUIDashboardView.h"
  11 +#import "TiUIDashboardItemProxy.h"
11 12 #import "TiUtils.h"
12 13 #import "LauncherItem.h"
13 14 #import "LauncherButton.h"
@@ -27,6 +28,23 @@ -(void)stopEditing:(id)args
27 28 [[self view] performSelectorOnMainThread:@selector(stopEditing) withObject:nil waitUntilDone:NO];
28 29 }
29 30
  31 +-(void)addItem:(id)item
  32 +{
  33 + ENSURE_UI_THREAD_1_ARG(item);
  34 + ENSURE_SINGLE_ARG(item, TiUIDashboardItemProxy);
  35 + TiUIDashboardView *v = (TiUIDashboardView*)[self view];
  36 + LauncherView *launcher = [v launcher];
  37 + [launcher addItem:((TiUIDashboardItemProxy *)item).item animated:YES];
  38 +}
  39 +
  40 +-(void)removeItem:(id)item
  41 +{
  42 + ENSURE_UI_THREAD_1_ARG(item);
  43 + ENSURE_SINGLE_ARG(item, TiUIDashboardItemProxy);
  44 + TiUIDashboardView *v = (TiUIDashboardView*)[self view];
  45 + LauncherView *launcher = [v launcher];
  46 + [launcher removeItem:((TiUIDashboardItemProxy *)item).item animated:YES];
  47 +}
30 48
31 49 -(void)fireEvent:(NSString *)type withObject:(id)obj withSource:(id)source propagate:(BOOL)propagate
32 50 {

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.