This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Blinking Animation of Multiply Drawables in ActionBar Toolbar on Android | |
//You can use AnimationDrawable, if you don't want to custom blinking animation | |
private void initAnimationOfCustomPins() { | |
ActionBar actionBar = getActionBar(); | |
if (actionBar == null || !Constant.USE_ANIMATION_OF_CUSTOM_PINS) { | |
return; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// this func show CNContactViewController for new contact and fill it using CNMutableContact | |
// Remember about permissions | |
func createContcat() { | |
if #available(iOS 9.0, *) { | |
let contact = CNMutableContact() | |
contact.givenName = "Jack" | |
contact.familyName = "Sparrow" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <React/RCTViewManager.h> | |
#import <React/RCTUIManager.h> | |
#import <React/RCTLog.h> | |
RCT_EXPORT_METHOD(goToPreviousPage:(nonnull NSNumber*) reactTag) { | |
[self.bridge.uiManager addUIBlock:^(RCTUIManager *uiManager, NSDictionary<NSNumber *,UIView *> *viewRegistry) { | |
NativeView *view = viewRegistry[reactTag]; | |
if (!view || ![view isKindOfClass:[NativeView class]]) { | |
RCTLogError(@"Cannot find NativeView with tag #%@", reactTag); | |
return; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyNativeView extends React.Component<Props> { | |
goToNextPage = () => { | |
UIManager.dispatchViewManagerCommand( | |
ReactNative.findNodeHandle(this), | |
UIManager.getViewManagerConfig('RNCMyNativeView').Commands.goToNextPage, | |
[] | |
); | |
}; | |
goToPreviousPage = () => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyNativeView extends React.Component<Props> { | |
goToNextPage = () => { | |
NativeModules.RNCMyNativeView.goToNextPage(); | |
}; | |
goToPreviousPage = () => { | |
NativeModules.RNCMyNativeView.goToPreviousPage(); | |
}; | |
render() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<View> | |
<MyNativeView ref={this.myNativeView} /> | |
<ButtonContainer> | |
<Button | |
title="Previous" | |
onPress={() => { | |
this.myNativeView.current.goToPreviousPage(); | |
}} | |
/> | |
<Button |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<View> | |
<MyNativeView /> | |
<ButtonContainer> | |
<Button title="Previous" /> | |
<Button title="Next" /> | |
</ButtonContainer> | |
<MyNativeView /> | |
<ButtonContainer> | |
<Button title="Previous" /> | |
<Button title="Next" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UIPageControl *pageIndicatorView = [[UIPageControl alloc] init]; | |
pageIndicatorView.translatesAutoresizingMaskIntoConstraints = NO; | |
NSLayoutConstraint *bottomConstraint = [pageIndicatorView.bottomAnchor constraintEqualToAnchor: self.view.bottomAnchor constant:0]; | |
NSLayoutConstraint *leadingConstraint = [pageIndicatorView.leadingAnchor constraintEqualToAnchor: self.view.leadingAnchor constant:0]; | |
NSLayoutConstraint *trailingConstraint = [pageIndicatorView.trailingAnchor constraintEqualToAnchor: self.view.trailingAnchor constant:0]; | |
[self.view addConstraints:@[bottomConstraint,leadingConstraint,trailingConstraint]]; | |
[self.view layoutIfNeeded]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const regex = /(^0[\,\.][0-9]{1,}$)|(^[1-9][0-9]{1,}$)|(^[0-9]$)|(^[1-9][0-9]{0,}[\,\.][0-9]{1,}$)/gm; | |
const str = `01 | |
001 | |
033 | |
0000033 | |
00000.2 | |
00000000000000 | |
01010101010 | |
0000.0 | |
aaa |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const regex = /(^\-?0[\,\.][0-9]{1,}$)|(^\-?[1-9][0-9]{1,}$)|(^[0-9]$)|(^\-?[1-9][0-9]{0,}[\,\.][0-9]{1,}$)|(^\-?[1-9]$)/gm; | |
const str = `01 | |
001 | |
033 | |
0000033 | |
00000.2 | |
00000000000000 | |
01010101010 | |
0000.0 | |
aaa |
OlderNewer