Added base architecture#5
Conversation
| init { | ||
| val client = OkHttpClient.Builder().build() | ||
| apiTransTrades = Retrofit.Builder() | ||
| .baseUrl("http://3.248.170.197:9999") |
There was a problem hiding this comment.
Энто в настройки бы вынести
There was a problem hiding this comment.
Энто в настройки бы вынести
не очень понял
There was a problem hiding this comment.
Урлы и порты обычно хочется выносить в настройки, ибо вот возьму, тачку перезагружу на AWS - и код протухнет, и надо пересобирать чтоб заработало, и менять именно в RetrofitManager :)
|
|
||
| class MainRepository { | ||
|
|
||
| private val apiRate = RetrofitManager.apiRate |
There was a problem hiding this comment.
Это котлиновский синглтон? Тогда ок.
| var rates: ArrayList<BigDecimal> = arrayListOf() | ||
| var dates: ArrayList<String> = arrayListOf() | ||
| val formatter = SimpleDateFormat("dd/MM/yyyy") | ||
| if (!dataLiveData.isNullOrEmpty()) |
There was a problem hiding this comment.
Тут явно видно Java код на котлине. Нужно будет глянуть в сторону основной фичи языка, null-safety, элвис оператор (?:) и т.д.
| @@ -0,0 +1,23 @@ | |||
| package com.example.mvvmkotlincoroutineretrofitdemo.view | |||
There was a problem hiding this comment.
Потом отдельным коммитом предлагаю таки переименовать package, куда-то в сторону uk.dsx.android.portfolio
For column graph added preparations for getting rates and multiplying
Need to hide keyboard when touching empty space
No description provided.