Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

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
This page is out of date. Refresh to see the latest.
Showing with 18 additions and 0 deletions.
  1. +18 −0 iphone/Classes/TiUIDashboardViewProxy.m
18 iphone/Classes/TiUIDashboardViewProxy.m
View
@@ -8,6 +8,7 @@
#import "TiUIDashboardViewProxy.h"
#import "TiUIDashboardView.h"
+#import "TiUIDashboardItemProxy.h"
#import "TiUtils.h"
#import "LauncherItem.h"
#import "LauncherButton.h"
@@ -27,6 +28,23 @@ -(void)stopEditing:(id)args
[[self view] performSelectorOnMainThread:@selector(stopEditing) withObject:nil waitUntilDone:NO];
}
+-(void)addItem:(id)item
+{
+ ENSURE_UI_THREAD_1_ARG(item);
+ ENSURE_SINGLE_ARG(item, TiUIDashboardItemProxy);
+ TiUIDashboardView *v = (TiUIDashboardView*)[self view];
+ LauncherView *launcher = [v launcher];
+ [launcher addItem:((TiUIDashboardItemProxy *)item).item animated:YES];
+}
+
+-(void)removeItem:(id)item
+{
+ ENSURE_UI_THREAD_1_ARG(item);
+ ENSURE_SINGLE_ARG(item, TiUIDashboardItemProxy);
+ TiUIDashboardView *v = (TiUIDashboardView*)[self view];
+ LauncherView *launcher = [v launcher];
+ [launcher removeItem:((TiUIDashboardItemProxy *)item).item animated:YES];
+}
-(void)fireEvent:(NSString *)type withObject:(id)obj withSource:(id)source propagate:(BOOL)propagate
{
Something went wrong with that request. Please try again.