|
|
@ -56,20 +56,22 @@ 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 { |
|
|
|
callBack.openExplore( |
|
|
|
kind.url?.let { kindUrl -> |
|
|
|
item.bookSourceUrl, |
|
|
|
callBack.openExplore( |
|
|
|
kind.title, |
|
|
|
item.bookSourceUrl, |
|
|
|
kind.url |
|
|
|
kind.title, |
|
|
|
) |
|
|
|
kindUrl |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
gl_child.addView(tv) |
|
|
|
gl_child.addView(tv) |
|
|
|
} |
|
|
|
} |
|
|
|