This commit is contained in:
ocean 2024-06-17 13:57:29 +08:00
parent 08c7dd3ccc
commit 948355b16c
18 changed files with 241 additions and 98 deletions

View File

@ -8,6 +8,7 @@ import kotlinx.coroutines.channels.Channel
import kotlinx.coroutines.isActive import kotlinx.coroutines.isActive
import kotlinx.coroutines.selects.select import kotlinx.coroutines.selects.select
import melody.offline.music.App import melody.offline.music.App
import melody.offline.music.R
import melody.offline.music.adapter.LikedSongsAdapter import melody.offline.music.adapter.LikedSongsAdapter
import melody.offline.music.ads.AdPlacement import melody.offline.music.ads.AdPlacement
import melody.offline.music.ads.LolAdWrapper import melody.offline.music.ads.LolAdWrapper
@ -94,6 +95,14 @@ class MoLikedSongsActivity : MoBaseActivity(), LikedSongsAdapter.OnItemFavorites
if (adapter != null) { if (adapter != null) {
adapter?.notifyDataSetChanged() adapter?.notifyDataSetChanged()
} }
LolAdWrapper.shared.loadAdShowNativeAd(
this,
AdPlacement.NATIVE_ME_PAGE_LIST,
binding.frameAd,
R.layout.ad_layout_admob_banner,
R.layout.ad_layout_max_banner
)
} }
private fun initView() { private fun initView() {

View File

@ -8,6 +8,7 @@ import kotlinx.coroutines.channels.Channel
import kotlinx.coroutines.isActive import kotlinx.coroutines.isActive
import kotlinx.coroutines.selects.select import kotlinx.coroutines.selects.select
import melody.offline.music.App import melody.offline.music.App
import melody.offline.music.R
import melody.offline.music.adapter.OfflineSongsAdapter import melody.offline.music.adapter.OfflineSongsAdapter
import melody.offline.music.ads.AdPlacement import melody.offline.music.ads.AdPlacement
import melody.offline.music.ads.LolAdWrapper import melody.offline.music.ads.LolAdWrapper
@ -81,6 +82,14 @@ class MoOfflineSongsActivity : MoBaseActivity() {
if (adapter != null) { if (adapter != null) {
adapter?.notifyDataSetChanged() adapter?.notifyDataSetChanged()
} }
LolAdWrapper.shared.loadAdShowNativeAd(
this,
AdPlacement.NATIVE_ME_PAGE_LIST,
binding.frameAd,
R.layout.ad_layout_admob_banner,
R.layout.ad_layout_max_banner
)
} }
private fun initView() { private fun initView() {

View File

@ -17,6 +17,7 @@ import melody.offline.music.App
import melody.offline.music.R import melody.offline.music.R
import melody.offline.music.sp.AppStore import melody.offline.music.sp.AppStore
import melody.offline.music.util.AnalysisUtil import melody.offline.music.util.AnalysisUtil
import melody.offline.music.util.LogTag
class LolAdWrapper { class LolAdWrapper {
@ -107,10 +108,10 @@ class LolAdWrapper {
App.app.isAdShowing.set(true) App.app.isAdShowing.set(true)
listener?.shown() listener?.shown()
AnalysisUtil.placeToLogEvent(placement, AnalysisAdState.AD_SHOWN) AnalysisUtil.placeToLogEvent(placement, AnalysisAdState.AD_SHOWN)
if (placement != AdPlacement.INST_SPLASH) {
App.app.lastAdDisplayTime.set(System.currentTimeMillis()) App.app.lastAdDisplayTime.set(System.currentTimeMillis())
} }
}
override fun onAfterClickClosed() {} override fun onAfterClickClosed() {}

View File

@ -55,7 +55,7 @@ object Constants {
[ [
"admob_inst", "admob_inst",
{ {
"ca-app-pub-3940256099942544/1033173712": 100 "ca-app-pub-1371732277241593/2206084561": 100
} }
] ]
], ],
@ -98,7 +98,7 @@ object Constants {
[ [
"admob_inst", "admob_inst",
{ {
"ca-app-pub-3940256099942544/1033173712": 100 "ca-app-pub-1371732277241593/4400663750": 100
} }
] ]
], ],
@ -117,7 +117,7 @@ object Constants {
[ [
"admob_native", "admob_native",
{ {
"ca-app-pub-3940256099942544/2247696110": 100 "ca-app-pub-1371732277241593/8583451341": 100
} }
] ]
], ],
@ -187,7 +187,7 @@ object Constants {
[ [
"admob_inst", "admob_inst",
{ {
"ca-app-pub-3940256099942544/1033173712": 100 "ca-app-pub-1371732277241593/3422963317": 100
} }
] ]
], ],
@ -230,7 +230,7 @@ object Constants {
[ [
"admob_inst", "admob_inst",
{ {
"ca-app-pub-3940256099942544/1033173712": 100 "ca-app-pub-1371732277241593/5437934325": 100
} }
] ]
], ],
@ -273,7 +273,7 @@ object Constants {
[ [
"admob_inst", "admob_inst",
{ {
"ca-app-pub-3940256099942544/1033173712": 100 "ca-app-pub-1371732277241593/2884402102": 100
} }
] ]
], ],
@ -316,7 +316,7 @@ object Constants {
[ [
"admob_inst", "admob_inst",
{ {
"ca-app-pub-3940256099942544/1033173712": 100 "ca-app-pub-1371732277241593/6695175673": 100
} }
] ]
], ],
@ -335,7 +335,7 @@ object Constants {
[ [
"admob_native", "admob_native",
{ {
"ca-app-pub-3940256099942544/2247696110": 100 "ca-app-pub-1371732277241593/7952895953": 100
} }
] ]
], ],
@ -405,7 +405,7 @@ object Constants {
[ [
"admob_inst", "admob_inst",
{ {
"ca-app-pub-3940256099942544/1033173712": 100 "ca-app-pub-1371732277241593/7860901770": 100
} }
] ]
], ],

View File

@ -12,6 +12,7 @@ import com.google.firebase.remoteconfig.FirebaseRemoteConfig
import com.google.firebase.remoteconfig.FirebaseRemoteConfigException import com.google.firebase.remoteconfig.FirebaseRemoteConfigException
import com.google.firebase.remoteconfig.FirebaseRemoteConfigSettings import com.google.firebase.remoteconfig.FirebaseRemoteConfigSettings
import com.google.firebase.remoteconfig.FirebaseRemoteConfigValue import com.google.firebase.remoteconfig.FirebaseRemoteConfigValue
import com.lol.apex.ok.google.adlibrary.LoLAds
import melody.offline.music.App import melody.offline.music.App
import melody.offline.music.BuildConfig import melody.offline.music.BuildConfig
import melody.offline.music.sp.AppStore import melody.offline.music.sp.AppStore
@ -20,7 +21,7 @@ import java.lang.ref.WeakReference
class RemoteConfig { class RemoteConfig {
private val TAG = LogTag.VO_TEST_ONLY private val TAG = LogTag.VO_REMOTE_ONLY
private var ctx: Context? = null private var ctx: Context? = null
private var mFirebaseRemoteConfig: FirebaseRemoteConfig? = null private var mFirebaseRemoteConfig: FirebaseRemoteConfig? = null
@ -54,8 +55,7 @@ class RemoteConfig {
mFirebaseRemoteConfig = FirebaseRemoteConfig.getInstance() mFirebaseRemoteConfig = FirebaseRemoteConfig.getInstance()
val configSettings = val configSettings =
FirebaseRemoteConfigSettings.Builder() //默认值12小时的最短提取间隔如果在间隔内取值则优先取上次的结果 FirebaseRemoteConfigSettings.Builder() //默认值12小时的最短提取间隔如果在间隔内取值则优先取上次的结果
.setMinimumFetchIntervalInSeconds(intervalTime) .setMinimumFetchIntervalInSeconds(intervalTime).build()
.build()
mFirebaseRemoteConfig!!.setConfigSettingsAsync(configSettings) mFirebaseRemoteConfig!!.setConfigSettingsAsync(configSettings)
} }
@ -71,7 +71,7 @@ class RemoteConfig {
} }
} }
} }
}catch (ignore: Exception) { } catch (ignore: Exception) {
} }
} }
@ -93,8 +93,7 @@ class RemoteConfig {
//24小时后重新再去获取 //24小时后重新再去获取
handler.removeMessages(MSG_REFRESH_CONFIG) handler.removeMessages(MSG_REFRESH_CONFIG)
handler.sendEmptyMessageDelayed( handler.sendEmptyMessageDelayed(
MSG_REFRESH_CONFIG, MSG_REFRESH_CONFIG, (1000 * 60 * 60 * 24).toLong()
(1000 * 60 * 60 * 24).toLong()
) )
} else { } else {
//这里需要重新再去获取 //这里需要重新再去获取
@ -111,13 +110,21 @@ class RemoteConfig {
for ((key, value) in all) { for ((key, value) in all) {
try { try {
LogTag.LogD( LogTag.LogD(
TAG, TAG, "from = " + from + "Key = " + key + " Value = " + value.asString()
"from = " + from + "Key = " + key + " Value = " + value.asString()
) )
if (TextUtils.equals(Constants.KEY_SHOULD_ENTER_MUSIC_JSON, key)) { if (TextUtils.equals(Constants.KEY_SHOULD_ENTER_MUSIC_JSON, key)) {
val shouldJson = value.asString() val shouldJson = value.asString()
appStore.shouldEnterMusicPageJson = shouldJson appStore.shouldEnterMusicPageJson = shouldJson
} }
if (TextUtils.equals(Constants.KEY_SHOW_AD_INTERVAL_TIME, key)) {
val t = value.asLong()
appStore.showAdIntervalTime = t
}
if (TextUtils.equals(Constants.KEY_AD_JSON, key)) {
val ad = value.asString()
appStore.adJson = ad
LoLAds.setAdConfig(ad)
}
} catch (ignore: Exception) { } catch (ignore: Exception) {
} }

View File

@ -102,6 +102,11 @@ class MoMeFragment : MoBaseFragment<FragmentMoMeBinding>() {
val favoriteBeans = App.appFavoriteDBManager.getAllFavoriteBeans() val favoriteBeans = App.appFavoriteDBManager.getAllFavoriteBeans()
val favorites = favoriteBeans.count { it.isFavorite } val favorites = favoriteBeans.count { it.isFavorite }
binding.likedSongsTv.text = "$favorites" binding.likedSongsTv.text = "$favorites"
}
override fun onResume() {
super.onResume()
initImmersionBar()
LolAdWrapper.shared.loadAdShowNativeAd( LolAdWrapper.shared.loadAdShowNativeAd(
requireActivity(), requireActivity(),
@ -112,11 +117,6 @@ class MoMeFragment : MoBaseFragment<FragmentMoMeBinding>() {
) )
} }
override fun onResume() {
super.onResume()
initImmersionBar()
}
override fun onHiddenChanged(hidden: Boolean) { override fun onHiddenChanged(hidden: Boolean) {
super.onHiddenChanged(hidden) super.onHiddenChanged(hidden)
if (!hidden) { if (!hidden) {

View File

@ -34,6 +34,7 @@ import melody.offline.music.view.SearchResultOtherView
import kotlinx.coroutines.channels.Channel import kotlinx.coroutines.channels.Channel
import kotlinx.coroutines.isActive import kotlinx.coroutines.isActive
import kotlinx.coroutines.selects.select import kotlinx.coroutines.selects.select
import melody.offline.music.R
import melody.offline.music.ads.AdPlacement import melody.offline.music.ads.AdPlacement
import melody.offline.music.ads.LolAdWrapper import melody.offline.music.ads.LolAdWrapper
import org.json.JSONObject import org.json.JSONObject
@ -77,6 +78,17 @@ class SearchFragment : MoBaseFragment<FragmentSearchBinding>(), TextWatcher,
onReceive() onReceive()
} }
override fun onResume() {
super.onResume()
LolAdWrapper.shared.loadAdShowNativeAd(
requireActivity(),
AdPlacement.NATIVE_SEARCH,
binding.frameAd,
R.layout.ad_layout_admob_banner,
R.layout.ad_layout_max_banner
)
}
private fun initView() { private fun initView() {
binding.cancelBtn.setOnClickListener { binding.cancelBtn.setOnClickListener {
buttonClickListener?.onFragmentClick() buttonClickListener?.onFragmentClick()

View File

@ -8,7 +8,7 @@ object LogTag {
const val VO_FRAGMENT_LOG = "vo-fragment-log" const val VO_FRAGMENT_LOG = "vo-fragment-log"
const val VO_API_LOG = "vo-api—log" const val VO_API_LOG = "vo-api—log"
const val VO_SERVICE_LOG = "vo-service—log" const val VO_SERVICE_LOG = "vo-service—log"
const val VO_REMOTE_ONLY = "vo-remote—log"
const val VO_TEST_ONLY = "vo-only—log" const val VO_TEST_ONLY = "vo-only—log"
fun LogD(tag: String, message: String) { fun LogD(tag: String, message: String) {

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<solid android:color="#000000" />
<corners
android:radius="6dp"/>
</shape>
</item>
</selector>

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<stroke
android:width="1dp"
android:color="@color/white" />
<corners android:radius="2dp" />
</shape>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#FF1A1A1A" />
<corners android:radius="4dp" />
</shape>

View File

@ -25,7 +25,10 @@
android:id="@+id/title_layout" android:id="@+id/title_layout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="16dp" android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="8dp"
android:orientation="horizontal"> android:orientation="horizontal">
<RelativeLayout <RelativeLayout
@ -52,6 +55,13 @@
android:textSize="18dp" /> android:textSize="18dp" />
</LinearLayout> </LinearLayout>
<FrameLayout
android:id="@+id/frame_ad"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp" />
<LinearLayout <LinearLayout
android:id="@+id/loadingLayout" android:id="@+id/loadingLayout"
android:layout_width="match_parent" android:layout_width="match_parent"
@ -109,7 +119,8 @@
<RelativeLayout <RelativeLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent"
android:layout_marginTop="8dp">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"

View File

@ -26,7 +26,10 @@
android:id="@+id/title_layout" android:id="@+id/title_layout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="16dp" android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="8dp"
android:orientation="horizontal"> android:orientation="horizontal">
<RelativeLayout <RelativeLayout
@ -53,6 +56,13 @@
android:textSize="18dp" /> android:textSize="18dp" />
</LinearLayout> </LinearLayout>
<FrameLayout
android:id="@+id/frame_ad"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp" />
<LinearLayout <LinearLayout
android:id="@+id/loadingLayout" android:id="@+id/loadingLayout"
android:layout_width="match_parent" android:layout_width="match_parent"
@ -110,7 +120,8 @@
<RelativeLayout <RelativeLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent"
android:layout_marginTop="8dp">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"

View File

@ -1,21 +1,33 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<com.google.android.gms.ads.nativead.NativeAdView xmlns:android="http://schemas.android.com/apk/res/android" <com.google.android.gms.ads.nativead.NativeAdView xmlns:android="http://schemas.android.com/apk/res/android"
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"
android:layout_height="match_parent"> android:layout_height="match_parent">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="122dp" android:layout_height="96dp"
android:background="@color/color_FFF1F1FB" android:background="@drawable/drw_admob_bg"
android:gravity="center_horizontal" android:gravity="center_horizontal"
android:orientation="horizontal"> android:orientation="horizontal">
<androidx.cardview.widget.CardView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_margin="4dp"
android:elevation="0dp"
app:cardBackgroundColor="@color/transparent"
app:cardCornerRadius="4dp"
app:cardElevation="0dp">
<com.google.android.gms.ads.nativead.MediaView <com.google.android.gms.ads.nativead.MediaView
android:id="@+id/mv_event_con" android:id="@+id/mv_event_con"
android:layout_width="148dp" android:layout_width="122dp"
android:layout_height="match_parent" /> android:layout_height="match_parent" />
</androidx.cardview.widget.CardView>
<ImageView <ImageView
android:id="@+id/im_event_icon" android:id="@+id/im_event_icon"
android:layout_width="60dp" android:layout_width="60dp"
@ -28,29 +40,39 @@
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1" android:layout_weight="1"
android:layout_marginTop="4dp"
android:layout_marginBottom="4dp"
android:gravity="center_vertical"
android:orientation="vertical" android:orientation="vertical"
android:paddingHorizontal="12dp"> android:paddingHorizontal="12dp">
<LinearLayout <LinearLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:gravity="center_vertical" android:gravity="center_vertical"
android:orientation="horizontal"> android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/drw_ad_tag_bg"
android:paddingStart="4dp"
android:paddingEnd="4dp"
android:text="AD"
android:textColor="@color/white"
android:textSize="12dp" />
<TextView <TextView
android:id="@+id/tv_event_title" android:id="@+id/tv_event_title"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="4dp" android:layout_marginStart="4dp"
android:drawableLeft="@mipmap/ad_tag"
android:drawablePadding="4dp"
android:ellipsize="end" android:ellipsize="end"
android:gravity="left" android:gravity="start"
android:lineSpacingExtra="0dp" android:lineSpacingExtra="0dp"
android:maxLines="1" android:maxLines="1"
android:singleLine="true" android:singleLine="true"
android:textColor="@color/theme_black" android:textColor="@color/white"
android:textSize="16dp" android:textSize="16dp"
tools:text="dddd dddd dddd ddd " /> tools:text="dddd dddd dddd ddd " />
</LinearLayout> </LinearLayout>
@ -60,11 +82,11 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="4dp" android:layout_marginTop="4dp"
android:gravity="left" android:gravity="start"
android:lineSpacingExtra="0dp" android:lineSpacingExtra="0dp"
android:maxLines="2" android:maxLines="2"
android:minHeight="28dp" android:minHeight="28dp"
android:textColor="@color/text_gray" android:textColor="@color/white_60"
android:textSize="12dp" android:textSize="12dp"
tools:text="xxxxx xxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" /> tools:text="xxxxx xxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" />
@ -72,12 +94,11 @@
android:id="@+id/tv_event_bt" android:id="@+id/tv_event_bt"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="8dp" android:layout_marginTop="4dp"
android:layout_marginBottom="6dp" android:background="@drawable/drw_btn_bg"
android:background="@drawable/bg_btn_ad"
android:gravity="center" android:gravity="center"
android:minHeight="36dp" android:minHeight="32dp"
android:textColor="@color/white" android:textColor="@color/black"
android:textSize="14dp" android:textSize="14dp"
android:textStyle="bold" android:textStyle="bold"
tools:text="action now " /> tools:text="action now " />

View File

@ -7,7 +7,7 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@drawable/bg_card_white_ad_round4dp" android:background="@drawable/drw_admob_bg"
android:orientation="vertical"> android:orientation="vertical">
<LinearLayout <LinearLayout
@ -27,26 +27,42 @@
<LinearLayout <LinearLayout
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:layout_weight="1" android:layout_weight="1"
android:layout_marginLeft="12dp"
android:orientation="vertical"> android:orientation="vertical">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingBottom="4dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/drw_ad_tag_bg"
android:paddingStart="4dp"
android:paddingEnd="4dp"
android:text="AD"
android:textColor="@color/white"
android:textSize="12dp" />
<TextView <TextView
android:id="@+id/tv_event_title" android:id="@+id/tv_event_title"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:drawablePadding="4dp" android:layout_marginStart="4dp"
android:ellipsize="end" android:ellipsize="end"
android:drawableLeft="@mipmap/ad_tag"
android:fontFamily="@string/Roboto_Medium" android:fontFamily="@string/Roboto_Medium"
android:lineSpacingExtra="0dp" android:lineSpacingExtra="0dp"
android:paddingBottom="4dp"
android:singleLine="true" android:singleLine="true"
android:textColor="@color/theme_black" android:textColor="@color/white"
android:textSize="16dp" android:textSize="16dp"
android:textStyle="bold" android:textStyle="bold"
tools:text="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" /> tools:text="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" />
</LinearLayout>
<TextView <TextView
android:id="@+id/tv_event_content" android:id="@+id/tv_event_content"
android:layout_width="wrap_content" android:layout_width="wrap_content"
@ -57,7 +73,7 @@
android:maxLines="2" android:maxLines="2"
android:paddingLeft="8dp" android:paddingLeft="8dp"
android:paddingRight="8dp" android:paddingRight="8dp"
android:textColor="@color/text_gray" android:textColor="@color/white_60"
android:textSize="12dp" android:textSize="12dp"
tools:text="xxxxxxxxxxxxxxxxxxxxx" /> tools:text="xxxxxxxxxxxxxxxxxxxxx" />
</LinearLayout> </LinearLayout>
@ -65,14 +81,14 @@
<FrameLayout <FrameLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_marginHorizontal="12dp" android:layout_height="wrap_content"
android:layout_height="wrap_content" > android:layout_marginHorizontal="12dp">
<com.google.android.gms.ads.nativead.MediaView <com.google.android.gms.ads.nativead.MediaView
android:id="@+id/mv_event_con" android:id="@+id/mv_event_con"
android:layout_width="match_parent" android:layout_width="match_parent"
tools:background="@color/color_FFF7F9FB" android:layout_height="152dp"
android:layout_height="152dp" /> tools:background="@color/black_60" />
</FrameLayout> </FrameLayout>
<androidx.appcompat.widget.AppCompatButton <androidx.appcompat.widget.AppCompatButton
@ -81,10 +97,10 @@
android:layout_height="48dp" android:layout_height="48dp"
android:layout_marginHorizontal="14dp" android:layout_marginHorizontal="14dp"
android:layout_marginTop="10dp" android:layout_marginTop="10dp"
android:background="@drawable/bg_btn_ad"
android:textColor="@color/white"
android:textSize="15dp"
android:layout_marginBottom="12dp" android:layout_marginBottom="12dp"
android:background="@drawable/drw_btn_bg"
android:textColor="@color/black"
android:textSize="15dp"
android:textStyle="bold" android:textStyle="bold"
tools:text="action now " /> tools:text="action now " />
</LinearLayout> </LinearLayout>

View File

@ -7,7 +7,7 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="122dp" android:layout_height="122dp"
android:background="@color/color_FFF1F1FB" android:background="@drawable/drw_admob_bg"
android:gravity="center_horizontal" android:gravity="center_horizontal"
android:orientation="horizontal" android:orientation="horizontal"
tools:ignore="MissingConstraints"> tools:ignore="MissingConstraints">
@ -15,7 +15,7 @@
<FrameLayout <FrameLayout
android:id="@+id/mv_event_con" android:id="@+id/mv_event_con"
android:layout_width="148dp" android:layout_width="148dp"
tools:background="@color/white" tools:background="#FF1A1A1A"
android:layout_height="match_parent" /> android:layout_height="match_parent" />
<ImageView <ImageView
@ -39,6 +39,15 @@
android:layout_marginTop="16dp" android:layout_marginTop="16dp"
android:gravity="center_vertical" android:gravity="center_vertical"
android:orientation="horizontal"> android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/drw_ad_tag_bg"
android:paddingStart="4dp"
android:paddingEnd="4dp"
android:text="AD"
android:textColor="@color/white"
android:textSize="12dp" />
<TextView <TextView
android:id="@+id/tv_event_title" android:id="@+id/tv_event_title"
@ -46,14 +55,13 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:ellipsize="end" android:ellipsize="end"
android:layout_marginLeft="4dp" android:layout_marginStart="4dp"
android:lineSpacingExtra="0dp" android:lineSpacingExtra="0dp"
android:drawablePadding="4dp" android:drawablePadding="4dp"
android:drawableLeft="@mipmap/ad_tag"
android:singleLine="true" android:singleLine="true"
android:gravity="left" android:gravity="start"
android:maxLines="1" android:maxLines="1"
android:textColor="@color/theme_black" android:textColor="@color/white"
android:textSize="16dp" android:textSize="16dp"
tools:text="dddd dddd dddd ddd " /> tools:text="dddd dddd dddd ddd " />
@ -75,10 +83,10 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:minHeight="28dp" android:minHeight="28dp"
android:layout_marginTop="4dp" android:layout_marginTop="4dp"
android:gravity="left" android:gravity="start"
android:lineSpacingExtra="0dp" android:lineSpacingExtra="0dp"
android:maxLines="2" android:maxLines="2"
android:textColor="@color/text_gray" android:textColor="@color/white_60"
android:textSize="12dp" android:textSize="12dp"
tools:text="xxxxx xxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" /> tools:text="xxxxx xxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" />
@ -89,7 +97,7 @@
android:ellipsize="end" android:ellipsize="end"
android:fontFamily="@string/Roboto_Regular" android:fontFamily="@string/Roboto_Regular"
android:layout_marginHorizontal="12dp" android:layout_marginHorizontal="12dp"
android:textColor="@color/theme_black" android:textColor="@color/white_60"
android:textSize="12dp" android:textSize="12dp"
android:visibility="gone" android:visibility="gone"
tools:text="xxxxxxxxxxxxxxxxxxxxx" /> tools:text="xxxxxxxxxxxxxxxxxxxxx" />
@ -102,8 +110,8 @@
android:layout_marginTop="8dp" android:layout_marginTop="8dp"
android:layout_marginBottom="6dp" android:layout_marginBottom="6dp"
android:gravity="center" android:gravity="center"
android:background="@drawable/bg_btn_ad" android:background="@drawable/drw_btn_bg"
android:textColor="@color/white" android:textColor="@color/black"
android:textSize="14dp" android:textSize="14dp"
android:textStyle="bold" android:textStyle="bold"
tools:text="action now " /> tools:text="action now " />

View File

@ -189,7 +189,9 @@
<FrameLayout <FrameLayout
android:id="@+id/frame_ad" android:id="@+id/frame_ad"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" /> android:layout_height="wrap_content"
android:layout_marginStart="14dp"
android:layout_marginEnd="14dp" />
</LinearLayout> </LinearLayout>

View File

@ -20,14 +20,16 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_below="@+id/view" android:layout_below="@+id/view"
android:orientation="vertical"> android:orientation="vertical"
android:paddingTop="16dp">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="18dp" android:layout_marginStart="12dp"
android:layout_marginTop="32dp" android:layout_marginTop="16dp"
android:layout_marginEnd="18dp" android:layout_marginEnd="12dp"
android:layout_marginBottom="16dp"
android:gravity="center_vertical" android:gravity="center_vertical"
android:orientation="horizontal"> android:orientation="horizontal">
@ -86,6 +88,13 @@
android:textSize="14dp" /> android:textSize="14dp" />
</LinearLayout> </LinearLayout>
<FrameLayout
android:id="@+id/frame_ad"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:layout_marginEnd="12dp" />
<LinearLayout <LinearLayout
android:id="@+id/loadingLayout" android:id="@+id/loadingLayout"
android:layout_width="match_parent" android:layout_width="match_parent"
@ -130,16 +139,16 @@
<androidx.core.widget.NestedScrollView <androidx.core.widget.NestedScrollView
android:id="@+id/contentScrollView" android:id="@+id/contentScrollView"
android:visibility="gone"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent"
android:visibility="gone">
<LinearLayout <LinearLayout
android:id="@+id/content_layout" android:id="@+id/content_layout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="18dp" android:layout_marginStart="18dp"
android:layout_marginEnd="18dp" android:layout_marginEnd="18dp"
android:layout_height="wrap_content"
android:orientation="vertical" /> android:orientation="vertical" />
</androidx.core.widget.NestedScrollView> </androidx.core.widget.NestedScrollView>
@ -156,10 +165,10 @@
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/searchSuggestionsRv" android:id="@+id/searchSuggestionsRv"
android:scrollbars="none"
android:overScrollMode="never"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:overScrollMode="never"
android:scrollbars="none"
tools:itemCount="1" tools:itemCount="1"
tools:listitem="@layout/search_suggestions_adapter_item" /> tools:listitem="@layout/search_suggestions_adapter_item" />
</LinearLayout> </LinearLayout>
@ -168,9 +177,8 @@
android:id="@+id/historyLayout" android:id="@+id/historyLayout"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="18dp" android:layout_marginStart="12dp"
android:layout_marginTop="16dp" android:layout_marginEnd="12dp"
android:layout_marginEnd="18dp"
android:orientation="vertical" android:orientation="vertical"
android:visibility="visible"> android:visibility="visible">
@ -206,9 +214,9 @@
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/historyRv" android:id="@+id/historyRv"
android:layout_width="match_parent" android:layout_width="match_parent"
android:scrollbars="none" android:layout_height="wrap_content"
android:overScrollMode="never" android:overScrollMode="never"
android:layout_height="wrap_content" /> android:scrollbars="none" />
</LinearLayout> </LinearLayout>