This file has been truncated, but you can view the full file.
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
[ | |
{ | |
"code": "AAA", | |
"lat": "-17.3595", | |
"lon": "-145.494", | |
"name": "Anaa Airport", | |
"city": "Anaa", | |
"state": "Tuamotu-Gambier", | |
"country": "French Polynesia", |
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
Wednesday, Sep 12, 2018 --> EEEE, MMM d, yyyy | |
09/12/2018 --> MM/dd/yyyy | |
09-12-2018 14:11 --> MM-dd-yyyy HH:mm | |
Sep 12, 2:11 PM --> MMM d, h:mm a | |
September 2018 --> MMMM yyyy | |
Sep 12, 2018 --> MMM d, yyyy | |
Wed, 12 Sep 2018 14:11:54 +0000 --> E, d MMM yyyy HH:mm:ss Z | |
2018-09-12T14:11:54+0000 --> yyyy-MM-dd'T'HH:mm:ssZ | |
12.09.18 --> dd.MM.yy | |
10:41:02.112 --> HH:mm:ss.SSS |
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
// create a new class for the custom decorator | |
class MarginItemDecorator(private val horizontalSpacing:Int , private val verticalSpacing:Int) : RecyclerView.ItemDecoration() { | |
override fun getItemOffsets(outRect: Rect, view: View, parent: RecyclerView, state: RecyclerView.State) { | |
super.getItemOffsets(outRect, view, parent, state) | |
outRect.right = horizontalSpacing | |
outRect.left = horizontalSpacing | |
outRect.top = verticalSpacing | |
outRect.bottom = verticalSpacing | |
} | |
} |
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
Basically, you need to create a custom drawable and add it as a background to your layout. example: | |
Create a file called customborder.xml in your drawable folder: | |
<?xml version="1.0" encoding="UTF-8"?> | |
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> | |
<corners android:radius="20dp"/> | |
<padding android:left="10dp" android:right="10dp" android:top="10dp" android:bottom="10dp"/> | |
<stroke android:width="1dp" android:color="#CCCCCC"/> | |
</shape> | |
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 UIKit | |
//swiftlint:disable superfluous_disable_command identifier_name line_length | |
enum AlertType { | |
case ERROR, INFO, ONOFF_INFOCOUPON, NO_NETWORK, LOGOUT | |
} | |
class AlertViewController: UIViewController { | |
@IBOutlet weak var alertContainerWidthConstraint: NSLayoutConstraint! | |
@IBOutlet weak var saveBtnViewHeight: NSLayoutConstraint! |
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
var countries = ["'Espagne","'Italie","aFrance"] | |
var cIndex = 0 | |
var initStringLength : Int? = 0 | |
override func viewDidAppear(_ animated: Bool) { | |
titleLabel.text = "#CetEteJeVisiteL" | |
initStringLength = titleLabel.text?.count | |
animateText(countries[cIndex]) | |
} |
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
//Pay attention to the fact that if you have layout constraints attached to it, you must refresh this as follows in your UIView subclass: | |
override func layoutSubviews() { | |
super.layoutSubviews() | |
roundCorners(corners: [.topLeft, .topRight], radius: 3.0) | |
} | |
extension UIView { | |
func roundCorners(corners: UIRectCorner, radius: CGFloat) { |
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
@IBOutlet weak var collectionView: UICollectionView! | |
// fill your datasource array with data | |
var datasource: [] = [] | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
startTimer() | |
} |
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
override func viewWillAppear(_ animated: Bool) { | |
NotificationCenter.default.addObserver(self,selector: #selector(self.keyboardDidShow(notification:)), | |
name: UIResponder.keyboardDidShowNotification, object: nil) | |
NotificationCenter.default.addObserver(self,selector: #selector(self.keyboardWillBeHidden(notification:)), | |
name: UIResponder.keyboardWillHideNotification, object: nil) | |
} | |
override func viewWillDisappear(_ animated: Bool) { |
NewerOlder