Skip to content

Instantly share code, notes, and snippets.

View LukyanovAnatoliy's full-sized avatar
🤖

Анатолий LukyanovAnatoliy

🤖
View GitHub Profile
{
"page": 1,
"results": [
{
"adult": false,
"genres": [
{
"name": "Drama"
}
],

Суть задания

Предлагается написать клиента для вымышленного сервиса базы-кинофильмов. Сервис предоставляет api, который отдает список фильмов. Формат выдачи такой:

https://gist.github.com/LukyanovAnatoliy/eca5141dedc79751b3d0b339649e06a3

Можно грузить json напрямую с гитхаба:

https://gist.githubusercontent.com/LukyanovAnatoliy/eca5141dedc79751b3d0b339649e06a3/raw/38f9419762adf27c34a3f052733b296385b6aa8d/movies.json

remoteDB.collection("Tasks")
.addSnapshotListener { querySnapshot, error ->
// querySnapshot - list of changes
// error - error
}
remoteDB.collection("Tasks")
.document("New task")
.set(mapToRemoteTask(task))
.addOnSuccessListener {
// Successful write
}
.addOnFailureListener {
// There was an error while writing
}
val taskData = HashMap<String, Any>()
taskData["title"] = task.title
taskData["created"] = Timestamp(task.created.time / 1000, 0)
remoteDB.collection("Tasks")
.document("New task")
.set(taskData)
.addOnSuccessListener {
// Successful write
}
val taskData = HashMap<String, Any>()
taskData["title"] = task.title
taskData["created"] = Timestamp(task.created.time / 1000, 0)
remoteDB.collection("Tasks")
.add(taskData)
.addOnSuccessListener {
// Successful write
}
.addOnFailureListener {
remoteDB.collection(“Tasks”)
.get()
.addOnSuccessListener { querySnapshot ->
// Successfully received data. List in querySnapshot.documents
val taskList: List<RemoteTask> = querySnapshot.toObjects(RemoteTask::class.java)
}
.addOnFailureListener { exception ->
// An error occurred while getting data
}
remoteDB.collection(“Tasks”)
.whereEqualTo("title", "Task1")
.get()
.addOnSuccessListener { querySnapshot ->
// Successfully received data. List in querySnapshot.documents
}
.addOnFailureListener { exception ->
// An error occurred while getting data
}
remoteDB.collection(“Tasks”)
.get()
.addOnSuccessListener { querySnapshot ->
// Successfully received data. List in querySnapshot.documents
}
.addOnFailureListener { exception ->
// An error occurred while getting data
}
@LukyanovAnatoliy
LukyanovAnatoliy / osago_private_policy
Created March 19, 2019 13:12
Calculator OSAGO privacy policy
## Privacy Policy
Анатолий Лукьянов built the Калькулятор ОСАГО app as a Free app. This SERVICE is provided by Анатолий Лукьянов at no cost and is intended for use as is.
This page is used to inform visitors regarding my policies with the collection, use, and disclosure of Personal Information if anyone decided to use my Service.
If you choose to use my Service, then you agree to the collection and use of information in relation to this policy. The Personal Information that I collect is used for providing and improving the Service. I will not use or share your information with anyone except as described in this Privacy Policy.
The terms used in this Privacy Policy have the same meanings as in our Terms and Conditions, which is accessible at Калькулятор ОСАГО unless otherwise defined in this Privacy Policy.