I am a beginner react native developer. I want to write a custom component to handle all maps related task (show map, markers, polygons & directions line) I am using react-native-maps library. Make a custom component called RRMapView which has following props:
- show loader
- allow scroll
- allow zoom
- show current location marker
- markers (each having a lat lng coordinate, custom image as optional & unique id)
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
func addAlert(title: String, message: String) { | |
let alert = UIAlertController( | |
title: title, | |
message: message, | |
preferredStyle: .alert | |
) | |
alert.addAction(UIAlertAction(title: "Ok", style: .default, handler: nil)) | |
self.present(alert, animated: true, completion: nil) | |
} |
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
fun animateForSearchClosedOnHome(onComplete: () -> Unit) { | |
val rootContent: View = rootView.findViewById(R.id.v_content) | |
val maxWidthTranslation = rootView.width.toFloat() / 4 | |
val animator = ObjectAnimator.ofFloat( | |
rootContent, | |
View.TRANSLATION_X, | |
-1 * maxWidthTranslation, | |
0f | |
) | |
animator.duration = 500 |
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
fun animateForSearchClosing(onComplete: () -> Unit) { | |
val searchContentAnimator = rootView.findViewById<LinearLayout>(R.id.ll_search_content).fadeOutAnimator( | |
duration = 100L, | |
customInterpolator = PathInterpolatorCompat.create(0.30f, 0.28f, 0.61f, 1.0f) | |
) | |
val searchToolbarAnimator = rootView.findViewById<Toolbar>(R.id.toolbar_search).fadeOutAnimator( | |
duration = 500, | |
customInterpolator = PathInterpolatorCompat.create(0.30f, 0.28f, 0.61f, 1.0f) |
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
fun animateForSearchOpening(onComplete: () -> Unit) { | |
val animator = rootView.findViewById<LinearLayout>(R.id.node_search).fadeInAnimator( | |
duration = 100L, | |
startDelay = 50L, | |
customInterpolator = PathInterpolatorCompat.create(0.30f, 0.28f, 0.61f, 1.0f) | |
) | |
val searchContentAnimator = rootView.findViewById<LinearLayout>(R.id.ll_search_content).fadeInAnimator( | |
duration = 100L, | |
customInterpolator = PathInterpolatorCompat.create(0.30f, 0.28f, 0.61f, 1.0f) | |
) |
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
fun animateForSearchOpenOnHome(onComplete: () -> Unit) { | |
val rootContent: View = rootView.findViewById(R.id.v_content) | |
val maxWidthTranslation = rootView.width.toFloat() / 4 | |
val animator = ObjectAnimator.ofFloat( | |
rootContent, | |
View.TRANSLATION_X, | |
0f, | |
-1 * maxWidthTranslation | |
) | |
animator.duration = 500 |
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
fun animateForSearchClosedOnHome(onComplete: () -> Unit) { | |
val rootContent: View = rootView.findViewById(R.id.v_content) | |
val maxWidthTranslation = rootView.width.toFloat() / 4 | |
val animator = ObjectAnimator.ofFloat( | |
rootContent, | |
View.TRANSLATION_X, | |
-1 * maxWidthTranslation, | |
0f | |
) | |
animator.duration = 500 |
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
/* | |
* Copyright (c) 2018. Uber Technologies | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
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 os | |
import json | |
from datetime import datetime, timedelta | |
import time | |
import requests | |
SLACK_URL = '<slack-hook-url-here>' | |
SLACK_ICON_URL = '<icon-url-for-message-here>' | |
SLACK_USERNAME = '<name-of-app-message-here>' |
NewerOlder