diff --git a/ad-admob/build.gradle.kts b/ad-admob/build.gradle.kts index 6677046..b7fc994 100644 --- a/ad-admob/build.gradle.kts +++ b/ad-admob/build.gradle.kts @@ -11,7 +11,6 @@ android { defaultConfig { minSdk = ProjectSetting.PROJECT_MIN_SDK - targetSdk = ProjectSetting.PROJECT_TARGET_SDK multiDexEnabled = true vectorDrawables.useSupportLibrary = true diff --git a/ad-admob/src/main/java/com/frogobox/admob/core/FrogoAdConsent.kt b/ad-admob/src/main/java/com/frogobox/admob/core/FrogoAdConsent.kt index 2bb385c..d1faad8 100644 --- a/ad-admob/src/main/java/com/frogobox/admob/core/FrogoAdConsent.kt +++ b/ad-admob/src/main/java/com/frogobox/admob/core/FrogoAdConsent.kt @@ -101,7 +101,7 @@ object FrogoAdConsent { // Loads a consent form. Must be called on the main thread. UserMessagingPlatform.loadConsentForm(callback.activity(), { consentForm -> if (consentInformation.consentStatus == ConsentInformation.ConsentStatus.REQUIRED) { - consentForm.show(callback.activity()) { formError -> + consentForm.show(callback.activity()) { if (consentInformation.consentStatus == ConsentInformation.ConsentStatus.OBTAINED) { // App can start requesting ads. callback.onConsentSuccess() diff --git a/ad-admob/src/main/java/com/frogobox/admob/widget/FrogoAdmobViewAdapter.kt b/ad-admob/src/main/java/com/frogobox/admob/widget/FrogoAdmobViewAdapter.kt index ddc11f4..16d43ad 100644 --- a/ad-admob/src/main/java/com/frogobox/admob/widget/FrogoAdmobViewAdapter.kt +++ b/ad-admob/src/main/java/com/frogobox/admob/widget/FrogoAdmobViewAdapter.kt @@ -33,7 +33,7 @@ import com.frogobox.recycler.core.FrogoRecyclerViewListener */ -abstract class FrogoAdmobViewAdapter : RecyclerView.Adapter>() { +abstract class FrogoAdmobViewAdapter : RecyclerView.Adapter>(), FrogoRecyclerNotifyListener { protected var viewCallback: IFrogoAdmobViewAdapter? = null protected var viewListener: FrogoRecyclerViewListener? = null @@ -47,54 +47,6 @@ abstract class FrogoAdmobViewAdapter : RecyclerView.Adapter { - - override fun frogoNotifyData(): MutableList { - return innerFrogoNotifyData() - } - - override fun frogoNotifyDataSetChanged() { - innerFrogoNotifyDataSetChanged() - } - - override fun frogoNotifyItemChanged(data: T, position: Int, payload: Any) { - innerFrogoNotifyItemChanged(data, position, payload) - } - - override fun frogoNotifyItemChanged(data: T, position: Int) { - innerFrogoNotifyItemChanged(data, position) - } - - override fun frogoNotifyItemInserted(data: T, position: Int) { - innerFrogoNotifyItemInserted(data, position) - } - - override fun frogoNotifyItemMoved(data: T, fromPosition: Int, toPosition: Int) { - innerFrogoNotifyItemMoved(data, fromPosition, toPosition) - } - - override fun frogoNotifyItemRangeChanged(data: List, positionStart: Int, payload: Any) { - innerFrogoNotifyItemRangeChanged(data, positionStart, payload) - } - - override fun frogoNotifyItemRangeChanged(data: List, positionStart: Int) { - innerFrogoNotifyItemRangeChanged(data, positionStart) - } - - override fun frogoNotifyItemRangeInserted(data: List, positionStart: Int) { - innerFrogoNotifyItemRangeInserted(data, positionStart) - } - - override fun frogoNotifyItemRangeRemoved(positionStart: Int, itemCount: Int) { - innerFrogoNotifyItemRangeRemoved(positionStart, itemCount) - } - - override fun frogoNotifyItemRemoved(position: Int) { - innerFrogoNotifyItemRemoved(position) - } - - } - override fun getItemCount(): Int { return if (hasEmptyView) { listCount = if (listData.size == 0) { @@ -126,7 +78,7 @@ abstract class FrogoAdmobViewAdapter : RecyclerView.Adapter, position: Int) { when (getItemViewType(position)) { RECYCLER_VIEW_TYPE_MENU_ITEM -> { - holder.bindItem(listData[position], position, viewListener, notifyListener) + holder.bindItem(listData[position], position, viewListener, this) } RECYCLER_VIEW_TYPE_BANNER_AD -> { holder.bindItemAdView(listData[position]) @@ -197,68 +149,69 @@ abstract class FrogoAdmobViewAdapter : RecyclerView.Adapter { + override fun frogoNotifyData(): MutableList { return listData } // Notify Data Set Changed - fun innerFrogoNotifyDataSetChanged() { + override fun frogoNotifyDataSetChanged() { notifyDataSetChanged() } // Notify Data Item Changed - fun innerFrogoNotifyItemChanged(data: T, position: Int, payload: Any) { + override fun frogoNotifyItemChanged(data: T, position: Int, payload: Any) { listData[position] = data notifyItemChanged(position, payload) } // Notify Data Item Changed - fun innerFrogoNotifyItemChanged(data: T, position: Int) { + override fun frogoNotifyItemChanged(data: T, position: Int) { listData[position] = data notifyItemChanged(position) } // Notify Data Item Inserted - fun innerFrogoNotifyItemInserted(data: T, position: Int) { + override fun frogoNotifyItemInserted(data: T, position: Int) { listData.add(position, data) notifyItemInserted(position) } // Notify Data Item Moved - fun innerFrogoNotifyItemMoved(data: T, fromPosition: Int, toPosition: Int) { + override fun frogoNotifyItemMoved(data: T, fromPosition: Int, toPosition: Int) { listData.removeAt(fromPosition) listData.add(toPosition, data) notifyItemMoved(fromPosition, toPosition) } // Notify Data Item Range Changed - fun innerFrogoNotifyItemRangeChanged(data: List, positionStart: Int, payload: Any) { + override fun frogoNotifyItemRangeChanged(data: List, positionStart: Int, payload: Any) { listData.addAll(positionStart, data) notifyItemRangeChanged(positionStart, data.size, payload) } // Notify Data Item Range Changed - fun innerFrogoNotifyItemRangeChanged(data: List, positionStart: Int) { + override fun frogoNotifyItemRangeChanged(data: List, positionStart: Int) { listData.addAll(positionStart, data) notifyItemRangeChanged(positionStart, data.size) } // Notify Data Item Range Inserted - fun innerFrogoNotifyItemRangeInserted(data: List, positionStart: Int) { + override fun frogoNotifyItemRangeInserted(data: List, positionStart: Int) { listData.addAll(positionStart, data) notifyItemRangeChanged(positionStart, data.size) } // Notify Data Item Range Removed - fun innerFrogoNotifyItemRangeRemoved(positionStart: Int, itemCount: Int) { + override fun frogoNotifyItemRangeRemoved(positionStart: Int, itemCount: Int) { listData.subList(positionStart, (positionStart + itemCount)).clear() notifyItemRangeRemoved(positionStart, itemCount) } // Notify Data Item Removed - fun innerFrogoNotifyItemRemoved(position: Int) { - listData.removeAt(position) - notifyItemRemoved(position) + override fun frogoNotifyItemRemoved(item: T) { + val index = listData.indexOf(item) + listData.remove(item) + notifyItemRemoved(index) } diff --git a/ad-core/build.gradle.kts b/ad-core/build.gradle.kts index 3055f5c..defe085 100644 --- a/ad-core/build.gradle.kts +++ b/ad-core/build.gradle.kts @@ -11,7 +11,6 @@ android { defaultConfig { minSdk = ProjectSetting.PROJECT_MIN_SDK - targetSdk = ProjectSetting.PROJECT_TARGET_SDK multiDexEnabled = true vectorDrawables.useSupportLibrary = true diff --git a/ad-general/build.gradle.kts b/ad-general/build.gradle.kts index 67d95c3..f3283fc 100644 --- a/ad-general/build.gradle.kts +++ b/ad-general/build.gradle.kts @@ -11,7 +11,6 @@ android { defaultConfig { minSdk = ProjectSetting.PROJECT_MIN_SDK - targetSdk = ProjectSetting.PROJECT_TARGET_SDK multiDexEnabled = true vectorDrawables.useSupportLibrary = true diff --git a/ad-unityad/build.gradle.kts b/ad-unityad/build.gradle.kts index 728409d..8e963df 100644 --- a/ad-unityad/build.gradle.kts +++ b/ad-unityad/build.gradle.kts @@ -54,7 +54,7 @@ dependencies { api(project(DependencyGradle.MODULE_LIB_FROGO_AD_CORE)) - api(Ad.unityAds("4.6.1")) + api(Ad.unityAds) implementation(DependencyGradle.FROGO_SDK) diff --git a/ad-unityad/src/main/java/com/frogobox/unityad/core/FrogoUnityAd.kt b/ad-unityad/src/main/java/com/frogobox/unityad/core/FrogoUnityAd.kt index 40cd971..55be78c 100644 --- a/ad-unityad/src/main/java/com/frogobox/unityad/core/FrogoUnityAd.kt +++ b/ad-unityad/src/main/java/com/frogobox/unityad/core/FrogoUnityAd.kt @@ -33,7 +33,7 @@ object FrogoUnityAd : IFrogoUnityAd { ) { if (unityGameId != "") { - if (!UnityAds.isInitialized()) { + if (!UnityAds.isInitialized) { UnityAds.initialize( context, unityGameId, @@ -72,7 +72,7 @@ object FrogoUnityAd : IFrogoUnityAd { ) { if (adInterstitialUnitId != "") { - if (UnityAds.isInitialized()) { + if (UnityAds.isInitialized) { callback?.onShowAdRequestProgress(TAG, "$TAG [Unity showAdInterstitial] >> Run - onShowAdRequestProgress") UnityAds.load(adInterstitialUnitId, object : IUnityAdsLoadListener { @@ -82,7 +82,7 @@ object FrogoUnityAd : IFrogoUnityAd { message: String ) { callback?.onHideAdRequestProgress(TAG, "$TAG [Unity showAdInterstitial] >> Run - onHideAdRequestProgress : onUnityAdsShowFailure") - callback?.onAdFailed(TAG, "$TAG [Unity showAdInterstitial] >> Error - UnityAds Error Initilized [status] : ${UnityAds.isInitialized()}") + callback?.onAdFailed(TAG, "$TAG [Unity showAdInterstitial] >> Error - UnityAds Error Initilized [status] : ${UnityAds.isInitialized}") } override fun onUnityAdsAdLoaded(placementId: String) { @@ -120,7 +120,7 @@ object FrogoUnityAd : IFrogoUnityAd { } }) } else { - callback?.onAdFailed(TAG, "$TAG [Unity showAdInterstitial] >> Error - UnityAds Error Initilized [status] : ${UnityAds.isInitialized()}") + callback?.onAdFailed(TAG, "$TAG [Unity showAdInterstitial] >> Error - UnityAds Error Initilized [status] : ${UnityAds.isInitialized}") } } else { callback?.onAdFailed(TAG, "$TAG Unity Ad Interstitial id is Empty") diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index dfafac3..f941d9a 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -9,6 +9,7 @@ android:name=".SampleAdmobApplication" android:allowBackup="true" android:enableOnBackInvokedCallback="true" + android:hardwareAccelerated="true" android:icon="@drawable/ic_apps" android:label="@string/app_name" android:roundIcon="@drawable/ic_apps" @@ -18,29 +19,36 @@ + android:exported="false" + android:hardwareAccelerated="true" /> + android:exported="false" + android:hardwareAccelerated="true" /> + android:exported="false" + android:hardwareAccelerated="true" /> + android:exported="false" + android:hardwareAccelerated="true" /> + android:hardwareAccelerated="true"/> + android:exported="false" + android:hardwareAccelerated="true" /> + android:exported="false" + android:hardwareAccelerated="true" /> + android:exported="false" + android:hardwareAccelerated="true" /> () { ) { } - override fun onItemLongClicked( - view: View, - data: Any, - position: Int, - notifyListener: FrogoRecyclerNotifyListener - ) { + override fun areContentsTheSame(oldItem: Any, newItem: Any): Boolean { + return oldItem == newItem + } + + override fun areItemsTheSame(oldItem: Any, newItem: Any): Boolean { + return oldItem == newItem } + }) return adapter } diff --git a/app/src/main/java/com/frogobox/appadmob/mvvm/news/NewsActivity.kt b/app/src/main/java/com/frogobox/appadmob/mvvm/news/NewsActivity.kt index a6abb7b..93e3628 100644 --- a/app/src/main/java/com/frogobox/appadmob/mvvm/news/NewsActivity.kt +++ b/app/src/main/java/com/frogobox/appadmob/mvvm/news/NewsActivity.kt @@ -86,13 +86,14 @@ class NewsActivity : BaseActivity() { ) { } - override fun onItemLongClicked( - view: View, - data: Any, - position: Int, - notifyListener: FrogoRecyclerNotifyListener - ) { + override fun areContentsTheSame(oldItem: Any, newItem: Any): Boolean { + return oldItem == newItem + } + + override fun areItemsTheSame(oldItem: Any, newItem: Any): Boolean { + return oldItem == newItem } + }) return adapter } diff --git a/build.gradle.kts b/build.gradle.kts index 013217c..6bbcce9 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,10 +1,10 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. plugins { - id("com.android.application") version "8.2.0" apply false - id("com.android.library") version "8.2.0" apply false + id("com.android.application") version "8.3.1" apply false + id("com.android.library") version "8.3.1" apply false id("org.jetbrains.kotlin.android") version DependencyGradle.KOTLIN_VERSION apply false } tasks.register("clean", Delete::class) { - delete(rootProject.buildDir) + delete(rootProject.layout.buildDirectory) } \ No newline at end of file diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index 87b7291..b2af3a6 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -12,6 +12,6 @@ repositories { dependencies{ // open-build-src - implementation("com.github.frogobox:open-build-src:3.0.2") + implementation("com.github.frogobox:open-build-src:3.0.3") } \ No newline at end of file diff --git a/buildSrc/src/main/kotlin/DependencyGradle.kt b/buildSrc/src/main/kotlin/DependencyGradle.kt index 754203b..d20e828 100644 --- a/buildSrc/src/main/kotlin/DependencyGradle.kt +++ b/buildSrc/src/main/kotlin/DependencyGradle.kt @@ -20,7 +20,7 @@ object DependencyGradle { const val FROGO_UI_VERSION = "2.0.1" const val FROGO_SDK_VERSION = "2.2.5" const val FROGO_CONSUME_API_VERSION = "2.5.2" - const val FROGO_RECYCLER_VIEW_VERSION = "4.3.6" + const val FROGO_RECYCLER_VIEW_VERSION = "4.4.1" const val FROGO_UI = "com.github.frogobox:frogo-ui:$FROGO_UI_VERSION" const val FROGO_SDK = "com.github.frogobox:frogo-sdk:$FROGO_SDK_VERSION" diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 6c883c7..d9d3179 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStorePath=wrapper/dists zipStoreBase=GRADLE_USER_HOME -distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-all.zip \ No newline at end of file +distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-all.zip \ No newline at end of file diff --git a/settings.gradle.kts b/settings.gradle.kts index ab048c0..c9913d5 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,7 +1,13 @@ pluginManagement { repositories { gradlePluginPortal() - google() + google{ + content { + includeGroupByRegex("com\\.android.*") + includeGroupByRegex("com\\.google.*") + includeGroupByRegex("androidx.*") + } + } mavenCentral() maven("https://jitpack.io") }