메시지 - 배너 광고 추가
This commit is contained in:
parent
52e6965472
commit
f9401d91c4
|
@ -63,6 +63,7 @@ android {
|
||||||
resValue 'string', 'admob_following_channel_list_banner_unit_id', 'ca-app-pub-1299501215847962/9013979925'
|
resValue 'string', 'admob_following_channel_list_banner_unit_id', 'ca-app-pub-1299501215847962/9013979925'
|
||||||
resValue 'string', 'admob_live_now_all_list_banner_unit_id', 'ca-app-pub-1299501215847962/7226255534'
|
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_creator_channel_banner_unit_id', 'ca-app-pub-1299501215847962/4594592451'
|
||||||
|
resValue 'string', 'admob_message_banner_unit_id', 'ca-app-pub-1299501215847962/1161494343'
|
||||||
}
|
}
|
||||||
|
|
||||||
debug {
|
debug {
|
||||||
|
@ -85,6 +86,7 @@ android {
|
||||||
resValue 'string', 'admob_following_channel_list_banner_unit_id', 'ca-app-pub-3940256099942544/6300978111'
|
resValue 'string', 'admob_following_channel_list_banner_unit_id', 'ca-app-pub-3940256099942544/6300978111'
|
||||||
resValue 'string', 'admob_live_now_all_list_banner_unit_id', 'ca-app-pub-3940256099942544/6300978111'
|
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_creator_channel_banner_unit_id', 'ca-app-pub-3940256099942544/6300978111'
|
||||||
|
resValue 'string', 'admob_message_banner_unit_id', 'ca-app-pub-3940256099942544/6300978111'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
compileOptions {
|
compileOptions {
|
||||||
|
|
|
@ -2,6 +2,7 @@ package kr.co.vividnext.sodalive.message
|
||||||
|
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.view.View
|
import android.view.View
|
||||||
|
import com.google.android.gms.ads.AdRequest
|
||||||
import com.google.android.material.tabs.TabLayout
|
import com.google.android.material.tabs.TabLayout
|
||||||
import kr.co.vividnext.sodalive.R
|
import kr.co.vividnext.sodalive.R
|
||||||
import kr.co.vividnext.sodalive.base.BaseFragment
|
import kr.co.vividnext.sodalive.base.BaseFragment
|
||||||
|
@ -14,9 +15,29 @@ class MessageFragment : BaseFragment<FragmentMessageBinding>(FragmentMessageBind
|
||||||
super.onViewCreated(view, savedInstanceState)
|
super.onViewCreated(view, savedInstanceState)
|
||||||
|
|
||||||
setupView()
|
setupView()
|
||||||
|
setupAdMob()
|
||||||
changeFragment("message")
|
changeFragment("message")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onResume() {
|
||||||
|
super.onResume()
|
||||||
|
binding.adView.resume()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onPause() {
|
||||||
|
binding.adView.pause()
|
||||||
|
super.onPause()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onDestroy() {
|
||||||
|
binding.adView.destroy()
|
||||||
|
super.onDestroy()
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun setupAdMob() {
|
||||||
|
binding.adView.loadAd(AdRequest.Builder().build())
|
||||||
|
}
|
||||||
|
|
||||||
private fun setupView() {
|
private fun setupView() {
|
||||||
val tabs = binding.tabs
|
val tabs = binding.tabs
|
||||||
tabs.addTab(tabs.newTab().setText("문자").setTag("message"))
|
tabs.addTab(tabs.newTab().setText("문자").setTag("message"))
|
||||||
|
|
|
@ -7,6 +7,7 @@ import android.os.Bundle
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager
|
import androidx.recyclerview.widget.LinearLayoutManager
|
||||||
import androidx.recyclerview.widget.RecyclerView
|
import androidx.recyclerview.widget.RecyclerView
|
||||||
|
import com.google.android.gms.ads.AdRequest
|
||||||
import com.jakewharton.rxbinding4.widget.textChanges
|
import com.jakewharton.rxbinding4.widget.textChanges
|
||||||
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
|
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
|
||||||
import io.reactivex.rxjava3.schedulers.Schedulers
|
import io.reactivex.rxjava3.schedulers.Schedulers
|
||||||
|
@ -29,6 +30,7 @@ class SelectMessageRecipientActivity : BaseActivity<ActivitySelectMessageRecipie
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
|
|
||||||
bindData()
|
bindData()
|
||||||
|
setupAdMob()
|
||||||
viewModel.searchUser("")
|
viewModel.searchUser("")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -70,6 +72,25 @@ class SelectMessageRecipientActivity : BaseActivity<ActivitySelectMessageRecipie
|
||||||
recyclerView.adapter = adapter
|
recyclerView.adapter = adapter
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onResume() {
|
||||||
|
super.onResume()
|
||||||
|
binding.adView.resume()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onPause() {
|
||||||
|
binding.adView.pause()
|
||||||
|
super.onPause()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onDestroy() {
|
||||||
|
binding.adView.destroy()
|
||||||
|
super.onDestroy()
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun setupAdMob() {
|
||||||
|
binding.adView.loadAd(AdRequest.Builder().build())
|
||||||
|
}
|
||||||
|
|
||||||
@SuppressLint("NotifyDataSetChanged")
|
@SuppressLint("NotifyDataSetChanged")
|
||||||
private fun bindData() {
|
private fun bindData() {
|
||||||
compositeDisposable.add(
|
compositeDisposable.add(
|
||||||
|
|
|
@ -9,6 +9,7 @@ import android.widget.Toast
|
||||||
import androidx.activity.result.ActivityResultLauncher
|
import androidx.activity.result.ActivityResultLauncher
|
||||||
import androidx.activity.result.contract.ActivityResultContracts
|
import androidx.activity.result.contract.ActivityResultContracts
|
||||||
import androidx.core.content.IntentCompat
|
import androidx.core.content.IntentCompat
|
||||||
|
import com.google.android.gms.ads.AdRequest
|
||||||
import com.jakewharton.rxbinding4.widget.textChanges
|
import com.jakewharton.rxbinding4.widget.textChanges
|
||||||
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
|
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
|
||||||
import io.reactivex.rxjava3.schedulers.Schedulers
|
import io.reactivex.rxjava3.schedulers.Schedulers
|
||||||
|
@ -53,6 +54,7 @@ class TextMessageWriteActivity : BaseActivity<ActivityTextMessageWriteBinding>(
|
||||||
}
|
}
|
||||||
|
|
||||||
bindData()
|
bindData()
|
||||||
|
setupAdMob()
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressLint("SetTextI18n")
|
@SuppressLint("SetTextI18n")
|
||||||
|
@ -91,6 +93,25 @@ class TextMessageWriteActivity : BaseActivity<ActivityTextMessageWriteBinding>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onResume() {
|
||||||
|
super.onResume()
|
||||||
|
binding.adView.resume()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onPause() {
|
||||||
|
binding.adView.pause()
|
||||||
|
super.onPause()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onDestroy() {
|
||||||
|
binding.adView.destroy()
|
||||||
|
super.onDestroy()
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun setupAdMob() {
|
||||||
|
binding.adView.loadAd(AdRequest.Builder().build())
|
||||||
|
}
|
||||||
|
|
||||||
private fun bindData() {
|
private fun bindData() {
|
||||||
compositeDisposable.add(
|
compositeDisposable.add(
|
||||||
binding.etMessage.textChanges().skip(1)
|
binding.etMessage.textChanges().skip(1)
|
||||||
|
|
|
@ -22,6 +22,7 @@ import androidx.core.content.IntentCompat
|
||||||
import androidx.core.content.res.ResourcesCompat
|
import androidx.core.content.res.ResourcesCompat
|
||||||
import coil.load
|
import coil.load
|
||||||
import coil.transform.RoundedCornersTransformation
|
import coil.transform.RoundedCornersTransformation
|
||||||
|
import com.google.android.gms.ads.AdRequest
|
||||||
import com.google.android.material.bottomsheet.BottomSheetBehavior
|
import com.google.android.material.bottomsheet.BottomSheetBehavior
|
||||||
import com.google.android.material.bottomsheet.BottomSheetDialog
|
import com.google.android.material.bottomsheet.BottomSheetDialog
|
||||||
import com.google.android.material.bottomsheet.BottomSheetDialogFragment
|
import com.google.android.material.bottomsheet.BottomSheetDialogFragment
|
||||||
|
@ -152,6 +153,7 @@ class VoiceMessageWriteFragment(
|
||||||
loadingDialog = LoadingDialog(requireActivity(), layoutInflater)
|
loadingDialog = LoadingDialog(requireActivity(), layoutInflater)
|
||||||
|
|
||||||
bindData()
|
bindData()
|
||||||
|
setupAdMob()
|
||||||
|
|
||||||
binding.ivClose.setOnClickListener { dismiss() }
|
binding.ivClose.setOnClickListener { dismiss() }
|
||||||
|
|
||||||
|
@ -259,7 +261,19 @@ class VoiceMessageWriteFragment(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onResume() {
|
||||||
|
super.onResume()
|
||||||
|
binding.adView.resume()
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onPause() {
|
||||||
|
binding.adView.pause()
|
||||||
|
super.onPause()
|
||||||
|
}
|
||||||
|
|
||||||
override fun onDestroy() {
|
override fun onDestroy() {
|
||||||
|
binding.adView.destroy()
|
||||||
|
|
||||||
if (mediaPlayer != null) {
|
if (mediaPlayer != null) {
|
||||||
mediaPlayer!!.release()
|
mediaPlayer!!.release()
|
||||||
mediaPlayer = null
|
mediaPlayer = null
|
||||||
|
@ -286,6 +300,10 @@ class VoiceMessageWriteFragment(
|
||||||
super.onDestroy()
|
super.onDestroy()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun setupAdMob() {
|
||||||
|
binding.adView.loadAd(AdRequest.Builder().build())
|
||||||
|
}
|
||||||
|
|
||||||
private fun startRecording() {
|
private fun startRecording() {
|
||||||
if (mediaRecorder == null) {
|
if (mediaRecorder == null) {
|
||||||
// safety check, don't start a new recording if one is already going
|
// safety check, don't start a new recording if one is already going
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:ads="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
@ -29,6 +30,14 @@
|
||||||
android:textSize="13.3sp"
|
android:textSize="13.3sp"
|
||||||
tools:ignore="LabelFor" />
|
tools:ignore="LabelFor" />
|
||||||
|
|
||||||
|
<com.google.android.gms.ads.AdView
|
||||||
|
android:id="@+id/ad_view"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="13.3dp"
|
||||||
|
ads:adSize="SMART_BANNER"
|
||||||
|
ads:adUnitId="@string/admob_message_banner_unit_id" />
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
android:id="@+id/rv_recipient"
|
android:id="@+id/rv_recipient"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:ads="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
@ -83,10 +84,19 @@
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
<ScrollView
|
<com.google.android.gms.ads.AdView
|
||||||
|
android:id="@+id/ad_view"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_below="@+id/rl_recipient"
|
android:layout_below="@+id/rl_recipient"
|
||||||
|
android:layout_marginTop="13.3dp"
|
||||||
|
ads:adSize="SMART_BANNER"
|
||||||
|
ads:adUnitId="@string/admob_message_banner_unit_id" />
|
||||||
|
|
||||||
|
<ScrollView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_below="@+id/ad_view"
|
||||||
android:layout_marginHorizontal="13.3dp"
|
android:layout_marginHorizontal="13.3dp"
|
||||||
android:layout_marginTop="13.3dp"
|
android:layout_marginTop="13.3dp"
|
||||||
android:background="@drawable/bg_round_corner_10_232323_9970ff">
|
android:background="@drawable/bg_round_corner_10_232323_9970ff">
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:ads="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
@ -32,6 +33,14 @@
|
||||||
android:layout_height="1dp"
|
android:layout_height="1dp"
|
||||||
android:background="@color/color_88909090" />
|
android:background="@color/color_88909090" />
|
||||||
|
|
||||||
|
<com.google.android.gms.ads.AdView
|
||||||
|
android:id="@+id/ad_view"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="13.3dp"
|
||||||
|
ads:adSize="SMART_BANNER"
|
||||||
|
ads:adUnitId="@string/admob_message_banner_unit_id" />
|
||||||
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:id="@+id/container"
|
android:id="@+id/container"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
<androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:ads="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
@ -10,6 +11,16 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<com.google.android.gms.ads.AdView
|
||||||
|
android:id="@+id/ad_view"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
ads:adSize="SMART_BANNER"
|
||||||
|
ads:adUnitId="@string/admob_message_banner_unit_id"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
@ -19,8 +30,8 @@
|
||||||
android:text="음성메시지"
|
android:text="음성메시지"
|
||||||
android:textColor="@color/white"
|
android:textColor="@color/white"
|
||||||
android:textSize="18.3sp"
|
android:textSize="18.3sp"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
ads:layout_constraintTop_toBottomOf="@+id/ad_view"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintStart_toStartOf="parent" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/iv_close"
|
android:id="@+id/iv_close"
|
||||||
|
@ -30,8 +41,8 @@
|
||||||
android:paddingHorizontal="26.7dp"
|
android:paddingHorizontal="26.7dp"
|
||||||
android:paddingTop="26.7dp"
|
android:paddingTop="26.7dp"
|
||||||
android:src="@drawable/ic_close_white"
|
android:src="@drawable/ic_close_white"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
ads:layout_constraintTop_toBottomOf="@+id/ad_view"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintEnd_toEndOf="parent" />
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:id="@+id/rl_select_recipient"
|
android:id="@+id/rl_select_recipient"
|
||||||
|
|
Loading…
Reference in New Issue