Sha256: 12551f9d92ca5e285198c05acb62ec54c86f7d31cfdc9b00c30331bb0d8f3c45

Contents?: true

Size: 1.5 KB

Versions: 8

Compression:

Stored size: 1.5 KB

Contents

#import "NativeTabbarSingleton.h"

extern void rho_create_tabbar(NSArray* items, NSDictionary* properties, id<IMethodResult>callback);
extern BOOL nativetabbar_started();
extern void remove_native_tabbar();
extern void native_tabbar_set_tab_badge(int index,char *val);
extern int native_tabbar_get_current_tab();
extern void native_tabbar_switch_tab(int index);

@implementation NativeTabbarSingleton



-(void) create:(NSArray*)tabElements tabBarProperties:(NSDictionary*)tabBarProperties methodResult:(id<IMethodResult>)methodResult {
    if (![tabElements isKindOfClass:[NSArray class]]) {
        NSLog(@"Tabbar.create ERROR - tabElements parameter should be Array !");
        return;
    }
    rho_create_tabbar(tabElements, tabBarProperties, methodResult);
}

-(void) currentTabIndex:(id<IMethodResult>)methodResult {
    [methodResult setResult:[NSNumber numberWithInt:native_tabbar_get_current_tab()]];
}

-(void) remove:(id<IMethodResult>)methodResult{
    remove_native_tabbar();
}

-(void) setTabBadge:(int)tabIndex badge:(NSString*)badge methodResult:(id<IMethodResult>)methodResult{
    native_tabbar_set_tab_badge(tabIndex, (char*)[badge UTF8String]);
}

-(void) switchTab:(int)tabIndex methodResult:(id<IMethodResult>)methodResult{
    native_tabbar_switch_tab(tabIndex);
}

-(void) isCreated:(id<IMethodResult>)methodResult {
    [methodResult setResult:[NSNumber numberWithBool:nativetabbar_started()]];
}

-(void) removeTab:(int)tabIndex methodResult:(id<IMethodResult>)methodResult{
    // unsupported
}



@end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
rhodes-5.5.0.22 lib/commonAPI/coreapi/ext/platform/iphone/impl/NativeTabbarSingleton.m
rhodes-5.5.2 lib/commonAPI/coreapi/ext/platform/iphone/impl/NativeTabbarSingleton.m
rhodes-5.5.0.7 lib/commonAPI/coreapi/ext/platform/iphone/impl/NativeTabbarSingleton.m
rhodes-5.5.0.3 lib/commonAPI/coreapi/ext/platform/iphone/impl/NativeTabbarSingleton.m
rhodes-5.5.0 lib/commonAPI/coreapi/ext/platform/iphone/impl/NativeTabbarSingleton.m
tauplatform-1.0.3 lib/commonAPI/coreapi/ext/platform/iphone/impl/NativeTabbarSingleton.m
tauplatform-1.0.2 lib/commonAPI/coreapi/ext/platform/iphone/impl/NativeTabbarSingleton.m
tauplatform-1.0.1 lib/commonAPI/coreapi/ext/platform/iphone/impl/NativeTabbarSingleton.m