-
Notifications
You must be signed in to change notification settings - Fork 17
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
Task/registration screen #76
base: master
Are you sure you want to change the base?
Conversation
5eac33c
to
85c7625
Compare
|
||
fun registration(context: Context, clearStack: Boolean = false) { | ||
context.startActivity(Intent(context, RegistrationActivity::class.java).apply { | ||
if (clearStack) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Не лучше shouldClearStack
?
} | ||
|
||
}) | ||
return isSuccessful |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Тут вроде isSuccessful
всегда будет true возвращаться. Запрос асинхронный и не успеет поменять isSuccesful
@@ -38,6 +39,10 @@ class ProfileActivity : AppCompatActivity(), KodeinAware, OnRefreshListener { | |||
showProfile() | |||
showFirstName(it.firstName) | |||
showLastName(it.lastName) | |||
if (it.avatarUrl.isEmpty()) { | |||
print("EMPTY AVATAR URL!!!!!!!!!!!!!!!!!!!!!!!!!!") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
лучше в лог вывести
var isSuccessful = false | ||
okHttpClient | ||
.newCall(request) | ||
.enqueue(object : Callback { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Как вариант, ты весь метод можешь обернуть в suspendCancellableCoroutine
suspend fun uploadImageToAws(url: String, fields: Map<String, String>, file: File) : Boolean= suspendCancellableCoroutine {
...
override fun onFailure(call: Call, e: IOException) {
continuation.resume(false)// or continuation.resumeWithException(e)
}
override fun onResponse(call: Call, response: Response) {
continuation.resume(true)
}
}
import org.kodein.di.KodeinAware | ||
import org.kodein.di.android.kodein | ||
import org.kodein.di.generic.instance | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extra line
) | ||
} | ||
|
||
private fun navigateToProfile(context: Context) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Context в делегате выглядит как-то не оч
68b4cc9
to
8bbe978
Compare
8bbe978
to
246ff85
Compare
Sign up with avatar uploading feature (via amazon services), made by Ruslan's PDP