Skip to content

Added base architecture#5

Open
Agamagsm13 wants to merge 74 commits into
masterfrom
BCV-33
Open

Added base architecture#5
Agamagsm13 wants to merge 74 commits into
masterfrom
BCV-33

Conversation

@Agamagsm13
Copy link
Copy Markdown
Contributor

No description provided.

init {
val client = OkHttpClient.Builder().build()
apiTransTrades = Retrofit.Builder()
.baseUrl("http://3.248.170.197:9999")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Энто в настройки бы вынести

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Энто в настройки бы вынести

не очень понял

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Урлы и порты обычно хочется выносить в настройки, ибо вот возьму, тачку перезагружу на AWS - и код протухнет, и надо пересобирать чтоб заработало, и менять именно в RetrofitManager :)


class MainRepository {

private val apiRate = RetrofitManager.apiRate
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Это котлиновский синглтон? Тогда ок.

var rates: ArrayList<BigDecimal> = arrayListOf()
var dates: ArrayList<String> = arrayListOf()
val formatter = SimpleDateFormat("dd/MM/yyyy")
if (!dataLiveData.isNullOrEmpty())
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Тут явно видно Java код на котлине. Нужно будет глянуть в сторону основной фичи языка, null-safety, элвис оператор (?:) и т.д.

@@ -0,0 +1,23 @@
package com.example.mvvmkotlincoroutineretrofitdemo.view
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Потом отдельным коммитом предлагаю таки переименовать package, куда-то в сторону uk.dsx.android.portfolio

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants