Use /sources/stats in the home #133
@ -55,7 +55,7 @@ class SourcesActivity : AppCompatActivity(), DIAware {
|
||||
binding.recyclerView.layoutManager = mLayoutManager
|
||||
|
||||
CoroutineScope(Dispatchers.Main).launch {
|
||||
val response = repository.getSources()
|
||||
val response = repository.getSourcesDetails()
|
||||
AmineB marked this conversation as resolved
|
||||
if (response.isNotEmpty()) {
|
||||
items = response
|
||||
val mAdapter = SourcesListAdapter(
|
||||
|
@ -68,7 +68,7 @@ class UpsertSourceActivity : AppCompatActivity(), DIAware {
|
||||
|
||||
private fun initFields(items: Map<String, SelfossModel.Spout>) {
|
||||
binding.nameInput.setText(existingSource!!.title)
|
||||
binding.tags.setText(existingSource!!.tags.joinToString(", "))
|
||||
binding.tags.setText(existingSource!!.tags?.joinToString(", "))
|
||||
binding.sourceUri.setText(existingSource!!.params?.url)
|
||||
binding.spoutsSpinner.setSelection(items.keys.indexOf(existingSource!!.spout))
|
||||
binding.progress.visibility = View.GONE
|
||||
|
@ -61,7 +61,7 @@ class SourcesListAdapter(
|
||||
c.circularBitmapDrawable(itm.getIcon(repository.baseUrl), binding.itemImage)
|
||||
}
|
||||
|
||||
if (itm.error.isNotBlank()) {
|
||||
if (itm.error.isNullOrBlank()) {
|
||||
AmineB marked this conversation as resolved
Outdated
AmineB
commented
This does not make sens. If the error is null or blank, the error text should not be displayed. This does not make sens. If the error is null or blank, the error text should not be displayed.
|
||||
binding.errorText.visibility = View.VISIBLE
|
||||
binding.errorText.text = itm.error
|
||||
} else {
|
||||
|
@ -84,7 +84,7 @@ class FilterSheetFragment : BottomSheetDialogFragment(), DIAware {
|
||||
) {
|
||||
val sourceGroup = binding.sourcesGroup
|
||||
|
||||
repository.getSources().forEach { source ->
|
||||
repository.getSourcesStats().forEach { source ->
|
||||
val c = Chip(context)
|
||||
c.ellipsize = TextUtils.TruncateAt.END
|
||||
|
||||
@ -141,9 +141,9 @@ class FilterSheetFragment : BottomSheetDialogFragment(), DIAware {
|
||||
selectedChip = c
|
||||
}
|
||||
|
||||
c.isEnabled = source.error.isBlank()
|
||||
c.isEnabled = source.error.isNullOrBlank()
|
||||
|
||||
if (source.error.isNotBlank() && Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
if (!source.error.isNullOrBlank() && Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
c.tooltipText = source.error
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user
Why would the SourcesActivity use the "public" route, instead of the actual one ?
I just changed the names of the methods it's the same endpoint.
I changed the names to make them more descriptive: getSourcesStats for /sources/stats and getSourcesDetails for /sources/details