{"id":18271119,"url":"https://github.com/smartapps-fr/DDExpandableButton","last_synced_at":"2025-04-05T01:31:03.399Z","repository":{"id":56907208,"uuid":"2132122","full_name":"smartapps-fr/DDExpandableButton","owner":"smartapps-fr","description":"A single-file iOS 5.0+ class designed to be used like an expandable UIButton ; as seen in the iOS Camera app for the \"flash\" button.","archived":false,"fork":false,"pushed_at":"2014-09-16T12:54:27.000Z","size":307,"stargazers_count":295,"open_issues_count":3,"forks_count":37,"subscribers_count":27,"default_branch":"master","last_synced_at":"2024-03-26T17:55:03.928Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/smartapps-fr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-07-31T11:45:51.000Z","updated_at":"2023-12-25T22:33:33.000Z","dependencies_parsed_at":"2022-08-20T19:50:23.727Z","dependency_job_id":null,"html_url":"https://github.com/smartapps-fr/DDExpandableButton","commit_stats":null,"previous_names":["ddebin/ddexpandablebutton"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smartapps-fr%2FDDExpandableButton","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smartapps-fr%2FDDExpandableButton/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smartapps-fr%2FDDExpandableButton/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/smartapps-fr%2FDDExpandableButton/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/smartapps-fr","download_url":"https://codeload.github.com/smartapps-fr/DDExpandableButton/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247276043,"owners_count":20912286,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-05T11:39:05.734Z","updated_at":"2025-04-05T01:31:02.795Z","avatar_url":"https://github.com/smartapps-fr.png","language":"Objective-C","readme":"DDExpandableButton\n==============\n\n\nPurpose\n--------------\n\n`DDExpandableButton` is a single-file iOS 5.0+ non-ARC class (ARC compatible) designed to be used like an expandable `UIButton` ; as seen in the iOS Camera app for the *flash* button.\n\n*Originally inspired by [ExpandyButton](https://github.com/iosdeveloper/ExpandyButton).*\n\n![button samples](http://github.com/ddebin/DDExpandableButton/raw/master/README.png)\n\n\nProperties\n--------------\n\nA DDExpandableButton has the following properties:\n\n - `@property (nonatomic,assign)\tBOOL\texpanded;`\n\tCurrent button status (if expanded or shrunk).\n\n - `@property (nonatomic,assign)\tBOOL\tuseAnimation;`\n\tUse animation during button state transitions.\n\n - `@property (nonatomic,assign)\tBOOL\ttoggleMode;`\n\tUse button as a toggle (like \"HDR On\" / \"HDR Off\" button in camera app).\n\n - `@property (nonatomic,assign)\tCGFloat timeout;`\n\tTo shrink the button after a timeout. Use `0` if you want to disable timeout.\n\n - `@property (nonatomic,assign)\tCGFloat horizontalPadding;`\n\tHorizontal padding space between items.\n\n - `@property (nonatomic,assign)\tCGFloat verticalPadding;`\n\tVertical padding space above and below items.\n\n - `@property (nonatomic,assign)\tCGFloat borderWidth;`\n\tWidth (thickness) of the button border.\n\n - `@property (nonatomic,assign)\tCGFloat innerBorderWidth;`\n\tWidth (thickness) of the inner borders between items.\n\n - `@property (nonatomic,assign)\tNSUInteger selectedItem;`\n\tSelected item number.\n\n - `@property (nonatomic,retain)\tUIColor *borderColor;`\n\tColor of the button and inner borders.\n\n - `@property (nonatomic,retain)\tUIColor *textColor;`\n\tColor of text labels.\n\n - `@property (nonatomic,retain)\tUIFont *labelFont;`\n\tFont of text labels.\n\n - `@property (nonatomic,retain)\tUIFont *unSelectedLabelFont;`\n\tFont of unselected text labels. `Nil` if not different from `labelFont`.\n\n - `@property (nonatomic,readonly) NSArray *labels;`\n\tAccess `UIView` used to draw labels.\n\n\nMethods\n--------------\n\nA DDExpandableButton has the following methods:\n\n - `- (id)initWithPoint:(CGPoint)point leftTitle:(id)leftTitle buttons:(NSArray *)buttons;`\n\t*Init* method where you can specify `leftTitle` and `buttons`.\n\n - `- (void)setSelectedItem:(NSUInteger)selected animated:(BOOL)animated;`\n\t*Animated* version of `- (void)setSelectedItem:(NSUInteger)selected`.\n\n - `- (void)setExpanded:(BOOL)expanded animated:(BOOL)animated;`\n\t*Animated* version of `- (void)setExpanded:(BOOL)expanded`.\n\n - `- (void)setLeftTitle:(id)leftTitle;`\n\tSet left title view : you can use a `NSString`, an `UIImage` or any `UIView` (but the view must implement `DDExpandableButtonViewSource` protocol).\n\n - `- (void)setButtons:(NSArray *)buttons;`\n\tSet buttons views : you can use a `NSString`, an `UIImage` or any `UIView` (but the view must implement `DDExpandableButtonViewSource` protocol).\n\n - `- (void)disableTimeout;`\n\tIf you want to disable timeout shrunk. You can set `timeout` to `0` also.\n\n - `- (void)updateDisplay;`\n\tWhen modifying button parameters, use this method to update button display.\n\n\nProtocols\n---------------\n\nThe `DDExpandableButtonViewSource` protocol, used when you specify the title or the different buttons, has the following methods:\n\n - `- (CGSize)defaultFrameSize;`\n\tReturns default frame size of the view, used when expanding the button.\n\n - `- (void)setHighlighted:(BOOL)highlighted;`\n\t*Optional*, used to change appearance of selected items.\n\n\nUsage\n---------------\n\nExample : a button with four text labels and a hook when value change.\n\n\tNSArray *buttons = [NSArray arrayWithObjects:@\"Black\", @\"Red\", @\"Green\", @\"Blue\", nil];\n\tDDExpandableButton *colorButton = [[[DDExpandableButton alloc] initWithPoint:CGPointMake(20, 70) leftTitle:@\"Color\" buttons:buttons] autorelease];\n\t[[self view] addSubview:colorButton];\n\t[colorButton addTarget:self action:@selector(toggleColor:) forControlEvents:UIControlEventValueChanged];\n\n\nLicense\n---------------\n\nDDExpandableButton is available under the MIT license. See the LICENSE file for more info.\n","funding_links":[],"categories":["etc"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmartapps-fr%2FDDExpandableButton","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmartapps-fr%2FDDExpandableButton","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmartapps-fr%2FDDExpandableButton/lists"}