network #28

Merged
AmineB merged 28 commits from davidoskky/ReaderForSelfoss-multiplatform:network into master 2022-08-22 19:01:16 +00:00
4 changed files with 53 additions and 0 deletions
Showing only changes of commit 8c69bb8c3c - Show all commits
@@ -6,11 +6,13 @@ import android.view.View
import android.widget.*
import androidx.appcompat.app.AppCompatActivity
import androidx.constraintlayout.widget.ConstraintLayout
import androidx.lifecycle.lifecycleScope
import bou.amine.apps.readerforselfossv2.android.databinding.ActivityAddSourceBinding
import bou.amine.apps.readerforselfossv2.android.themes.AppColors
import bou.amine.apps.readerforselfossv2.android.themes.Toppings
import bou.amine.apps.readerforselfossv2.android.utils.Config
import bou.amine.apps.readerforselfossv2.android.utils.isBaseUrlValid
import bou.amine.apps.readerforselfossv2.android.viewmodel.AppViewModel
import bou.amine.apps.readerforselfossv2.repository.Repository
import com.ftinc.scoop.Scoop
import kotlinx.coroutines.CoroutineScope
@@ -30,6 +32,7 @@ class AddSourceActivity : AppCompatActivity(), DIAware {
override val di by closestDI()
private val repository : Repository by instance()
private val viewModel : AppViewModel by instance()
override fun onCreate(savedInstanceState: Bundle?) {
appColors = AppColors(this@AddSourceActivity)
@@ -76,6 +79,16 @@ class AddSourceActivity : AppCompatActivity(), DIAware {
binding.sourceUri.text.toString()
)
}
lifecycleScope.launch {
AmineB marked this conversation as resolved Outdated
Outdated
Review

Instead of doing this in every activity, can't it be done in the MyApp class ?

(Same for the other activities)

Instead of doing this in every activity, can't it be done in the `MyApp` class ? (Same for the other activities)
Outdated
Review

Thank you, I didn't know this was possible...

Thank you, I didn't know this was possible...
viewModel.toastMessageProvider.collect { toastMessage ->
Toast.makeText(
this@AddSourceActivity,
toastMessage,
Toast.LENGTH_SHORT
).show()
}
}
}
override fun onResume() {
Internal Server Error - Amine's git
500 Internal Server Error

Gitea Version: 1.28.0+dev-211-ga30d865b78