diff --git a/app/build.gradle b/app/build.gradle
index f18e887..55dd6e7 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -64,6 +64,7 @@ android {
resValue 'string', 'admob_live_now_all_list_banner_unit_id', 'ca-app-pub-1299501215847962/7226255534'
resValue 'string', 'admob_creator_channel_banner_unit_id', 'ca-app-pub-1299501215847962/4594592451'
resValue 'string', 'admob_message_banner_unit_id', 'ca-app-pub-1299501215847962/1161494343'
+ resValue 'string', 'admob_explorer_banner_unit_id', 'ca-app-pub-1299501215847962/6200754952'
}
debug {
@@ -87,6 +88,7 @@ android {
resValue 'string', 'admob_live_now_all_list_banner_unit_id', 'ca-app-pub-3940256099942544/6300978111'
resValue 'string', 'admob_creator_channel_banner_unit_id', 'ca-app-pub-3940256099942544/6300978111'
resValue 'string', 'admob_message_banner_unit_id', 'ca-app-pub-3940256099942544/6300978111'
+ resValue 'string', 'admob_explorer_banner_unit_id', 'ca-app-pub-3940256099942544/6300978111'
}
}
compileOptions {
diff --git a/app/src/main/java/kr/co/vividnext/sodalive/explorer/ExplorerAdapter.kt b/app/src/main/java/kr/co/vividnext/sodalive/explorer/ExplorerAdapter.kt
index 64a7883..e53022d 100644
--- a/app/src/main/java/kr/co/vividnext/sodalive/explorer/ExplorerAdapter.kt
+++ b/app/src/main/java/kr/co/vividnext/sodalive/explorer/ExplorerAdapter.kt
@@ -12,6 +12,7 @@ import android.view.View
import android.view.ViewGroup
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
+import com.google.android.gms.ads.AdRequest
import kr.co.vividnext.sodalive.databinding.ItemExplorerBinding
import kr.co.vividnext.sodalive.extensions.dpToPx
@@ -25,9 +26,21 @@ class ExplorerAdapter(
private val context: Context,
private val binding: ItemExplorerBinding
) : RecyclerView.ViewHolder(binding.root) {
- fun bind(item: GetExplorerSectionResponse) {
+ fun bind(item: GetExplorerSectionResponse, index: Int) {
setTitle(item)
setCreatorList(item)
+
+ if (index == 1) {
+ setupAdMob()
+ } else {
+ binding.adView.visibility = View.GONE
+ }
+ }
+
+ private fun setupAdMob() {
+ val adRequest = AdRequest.Builder().build()
+ binding.adView.visibility = View.VISIBLE
+ binding.adView.loadAd(adRequest)
}
private fun setTitle(item: GetExplorerSectionResponse) {
@@ -108,7 +121,7 @@ class ExplorerAdapter(
)
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
- holder.bind(items[position])
+ holder.bind(items[position], index = position)
}
override fun getItemCount() = items.size
diff --git a/app/src/main/res/layout/item_explorer.xml b/app/src/main/res/layout/item_explorer.xml
index d8fc6e4..6e1808a 100644
--- a/app/src/main/res/layout/item_explorer.xml
+++ b/app/src/main/res/layout/item_explorer.xml
@@ -1,5 +1,6 @@
+
+