Skip to content

Commit

Permalink
update: build.gradle.kts
Browse files Browse the repository at this point in the history
  • Loading branch information
amirisback committed Mar 31, 2024
1 parent 501b2ed commit 32dbf42
Show file tree
Hide file tree
Showing 15 changed files with 65 additions and 99 deletions.
1 change: 0 additions & 1 deletion ad-admob/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ android {

defaultConfig {
minSdk = ProjectSetting.PROJECT_MIN_SDK
targetSdk = ProjectSetting.PROJECT_TARGET_SDK

multiDexEnabled = true
vectorDrawables.useSupportLibrary = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import com.frogobox.recycler.core.FrogoRecyclerViewListener
*/


abstract class FrogoAdmobViewAdapter<T> : RecyclerView.Adapter<FrogoAdmobViewHolder<T>>() {
abstract class FrogoAdmobViewAdapter<T> : RecyclerView.Adapter<FrogoAdmobViewHolder<T>>(), FrogoRecyclerNotifyListener<T> {

protected var viewCallback: IFrogoAdmobViewAdapter<T>? = null
protected var viewListener: FrogoRecyclerViewListener<T>? = null
Expand All @@ -47,54 +47,6 @@ abstract class FrogoAdmobViewAdapter<T> : RecyclerView.Adapter<FrogoAdmobViewHol
protected var customLayoutRestId: Int = 0
protected var emptyLayoutResId: Int = R.layout.frogo_rv_container_empty_view

protected var notifyListener = object : FrogoRecyclerNotifyListener<T> {

override fun frogoNotifyData(): MutableList<T> {
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<T>, positionStart: Int, payload: Any) {
innerFrogoNotifyItemRangeChanged(data, positionStart, payload)
}

override fun frogoNotifyItemRangeChanged(data: List<T>, positionStart: Int) {
innerFrogoNotifyItemRangeChanged(data, positionStart)
}

override fun frogoNotifyItemRangeInserted(data: List<T>, 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) {
Expand Down Expand Up @@ -126,7 +78,7 @@ abstract class FrogoAdmobViewAdapter<T> : RecyclerView.Adapter<FrogoAdmobViewHol
override fun onBindViewHolder(holder: FrogoAdmobViewHolder<T>, 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])
Expand Down Expand Up @@ -197,68 +149,69 @@ abstract class FrogoAdmobViewAdapter<T> : RecyclerView.Adapter<FrogoAdmobViewHol
}

// Notify Data List
fun innerFrogoNotifyData(): MutableList<T> {
override fun frogoNotifyData(): MutableList<T> {
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<T>, positionStart: Int, payload: Any) {
override fun frogoNotifyItemRangeChanged(data: List<T>, positionStart: Int, payload: Any) {
listData.addAll(positionStart, data)
notifyItemRangeChanged(positionStart, data.size, payload)
}

// Notify Data Item Range Changed
fun innerFrogoNotifyItemRangeChanged(data: List<T>, positionStart: Int) {
override fun frogoNotifyItemRangeChanged(data: List<T>, positionStart: Int) {
listData.addAll(positionStart, data)
notifyItemRangeChanged(positionStart, data.size)
}

// Notify Data Item Range Inserted
fun innerFrogoNotifyItemRangeInserted(data: List<T>, positionStart: Int) {
override fun frogoNotifyItemRangeInserted(data: List<T>, 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)
}


Expand Down
1 change: 0 additions & 1 deletion ad-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ android {

defaultConfig {
minSdk = ProjectSetting.PROJECT_MIN_SDK
targetSdk = ProjectSetting.PROJECT_TARGET_SDK

multiDexEnabled = true
vectorDrawables.useSupportLibrary = true
Expand Down
1 change: 0 additions & 1 deletion ad-general/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ android {

defaultConfig {
minSdk = ProjectSetting.PROJECT_MIN_SDK
targetSdk = ProjectSetting.PROJECT_TARGET_SDK

multiDexEnabled = true
vectorDrawables.useSupportLibrary = true
Expand Down
2 changes: 1 addition & 1 deletion ad-unityad/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ object FrogoUnityAd : IFrogoUnityAd {
) {

if (unityGameId != "") {
if (!UnityAds.isInitialized()) {
if (!UnityAds.isInitialized) {
UnityAds.initialize(
context,
unityGameId,
Expand Down Expand Up @@ -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 {

Expand All @@ -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) {
Expand Down Expand Up @@ -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")
Expand Down
24 changes: 16 additions & 8 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -18,29 +19,36 @@

<activity
android:name=".mvvm.banner.BannerActivity"
android:exported="false" />
android:exported="false"
android:hardwareAccelerated="true" />
<activity
android:name=".mvvm.rewarded.RewardedActivity"
android:exported="false" />
android:exported="false"
android:hardwareAccelerated="true" />
<activity
android:name=".mvvm.interstitial.InterstitialActivity"
android:exported="false" />
android:exported="false"
android:hardwareAccelerated="true" />
<activity
android:name=".mvvm.appopenad.AppOpenAdActivity"
android:exported="false" />
android:exported="false"
android:hardwareAccelerated="true" />
<activity
android:name=".mvvm.main.MainJavaActivity"
android:exported="false"
android:hardwareAccelerated="true" />
android:hardwareAccelerated="true"/>
<activity
android:name=".mvvm.movie.MovieActivity"
android:exported="false" />
android:exported="false"
android:hardwareAccelerated="true" />
<activity
android:name=".mvvm.news.NewsActivity"
android:exported="false" />
android:exported="false"
android:hardwareAccelerated="true" />
<activity
android:name=".mvvm.main.AboutUsActivity"
android:exported="false" />
android:exported="false"
android:hardwareAccelerated="true" />

<activity
android:name=".mvvm.main.MainActivity"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,14 @@ class MovieActivity : BaseActivity<ActivityRecyclerViewBinding>() {
) {
}

override fun onItemLongClicked(
view: View,
data: Any,
position: Int,
notifyListener: FrogoRecyclerNotifyListener<Any>
) {
override fun areContentsTheSame(oldItem: Any, newItem: Any): Boolean {
return oldItem == newItem
}

override fun areItemsTheSame(oldItem: Any, newItem: Any): Boolean {
return oldItem == newItem
}

})
return adapter
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,14 @@ class NewsActivity : BaseActivity<ActivityRecyclerViewBinding>() {
) {
}

override fun onItemLongClicked(
view: View,
data: Any,
position: Int,
notifyListener: FrogoRecyclerNotifyListener<Any>
) {
override fun areContentsTheSame(oldItem: Any, newItem: Any): Boolean {
return oldItem == newItem
}

override fun areItemsTheSame(oldItem: Any, newItem: Any): Boolean {
return oldItem == newItem
}

})
return adapter
}
Expand Down
6 changes: 3 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -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)
}
2 changes: 1 addition & 1 deletion buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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")

}
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/DependencyGradle.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-all.zip
8 changes: 7 additions & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
pluginManagement {
repositories {
gradlePluginPortal()
google()
google{
content {
includeGroupByRegex("com\\.android.*")
includeGroupByRegex("com\\.google.*")
includeGroupByRegex("androidx.*")
}
}
mavenCentral()
maven("https://jitpack.io")
}
Expand Down

0 comments on commit 32dbf42

Please sign in to comment.