Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added base architecture #5

Open
wants to merge 74 commits into
base: master
Choose a base branch
from
Open

Added base architecture #5

wants to merge 74 commits into from

Conversation

Agamagsm13
Copy link
Contributor

No description provided.

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

Choose a reason for hiding this comment

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

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

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

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

Copy link
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
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
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
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