|
|
@ -56,21 +56,23 @@ class FindBookAdapter(context: Context, private val scope: CoroutineScope, val c |
|
|
|
rotate_loading.show() |
|
|
|
rotate_loading.show() |
|
|
|
Coroutine.async(scope) { |
|
|
|
Coroutine.async(scope) { |
|
|
|
item.getExploreKinds() |
|
|
|
item.getExploreKinds() |
|
|
|
}.onSuccess { |
|
|
|
}.onSuccess { kindList -> |
|
|
|
it?.let { |
|
|
|
if (!kindList.isNullOrEmpty()) { |
|
|
|
gl_child.visible() |
|
|
|
gl_child.visible() |
|
|
|
gl_child.removeAllViews() |
|
|
|
gl_child.removeAllViews() |
|
|
|
it.map { kind -> |
|
|
|
kindList.map { kind -> |
|
|
|
val tv = LayoutInflater.from(context) |
|
|
|
val tv = LayoutInflater.from(context) |
|
|
|
.inflate(R.layout.item_text, gl_child, false) |
|
|
|
.inflate(R.layout.item_text, gl_child, false) |
|
|
|
tv.text_view.text = kind.title |
|
|
|
tv.text_view.text = kind.title |
|
|
|
tv.text_view.onClick { |
|
|
|
tv.text_view.onClick { |
|
|
|
|
|
|
|
kind.url?.let { kindUrl -> |
|
|
|
callBack.openExplore( |
|
|
|
callBack.openExplore( |
|
|
|
item.bookSourceUrl, |
|
|
|
item.bookSourceUrl, |
|
|
|
kind.title, |
|
|
|
kind.title, |
|
|
|
kind.url |
|
|
|
kindUrl |
|
|
|
) |
|
|
|
) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
gl_child.addView(tv) |
|
|
|
gl_child.addView(tv) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|