Skip to content

Commit

Permalink
Fix the bindables module to use library
Browse files Browse the repository at this point in the history
  • Loading branch information
skydoves committed Nov 6, 2024
1 parent d283658 commit cffabe0
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 15 deletions.
3 changes: 2 additions & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ plugins {
id(libs.plugins.kotlin.android.get().pluginId)
id(libs.plugins.kotlin.parcelize.get().pluginId)
id(libs.plugins.kotlin.kapt.get().pluginId)
id(libs.plugins.ksp.get().pluginId)
id(libs.plugins.hilt.plugin.get().pluginId)
}

Expand Down Expand Up @@ -56,7 +57,7 @@ dependencies {
implementation(libs.androidx.appcompat)
implementation(libs.androidx.activity)
implementation(libs.androidx.constraintlayout)
kapt(libs.hilt.compiler)
ksp(libs.hilt.compiler)

implementation(libs.androidx.material)
implementation(libs.androidx.fragment)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class MainActivity : BindingActivity<ActivityMainBinding>(R.layout.activity_main
) = Unit

override fun onPageSelected(position: Int) {
binding.mainBottomNavigation.menu.findItem(position).isChecked = true
binding.mainBottomNavigation.menu.getItem(position).isChecked = true
}
},
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,17 @@

package com.skydoves.bindablesdemo.recycler

import android.annotation.SuppressLint
import androidx.recyclerview.widget.DiffUtil

class PosterDiffUtil<T> : DiffUtil.ItemCallback<T>() {

override fun areItemsTheSame(oldItem: T, newItem: T): Boolean =
oldItem.hashCode() == newItem.hashCode()
override fun areItemsTheSame(oldItem: T & Any, newItem: T & Any): Boolean {
return oldItem.hashCode() == newItem.hashCode()
}

override fun areContentsTheSame(oldItem: T, newItem: T): Boolean =
oldItem.hashCode() == newItem.hashCode()
@SuppressLint("DiffUtilEquals")
override fun areContentsTheSame(oldItem: T & Any, newItem: T & Any): Boolean {
return oldItem == newItem
}
}
11 changes: 4 additions & 7 deletions bindables/api/bindables.api
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
public class androidx/databinding/DataBinderMapperImpl : androidx/databinding/MergedDataBinderMapper {
}

public abstract interface class androidx/databinding/DataBindingComponent {
}

public class androidx/databinding/library/baseAdapters/BR {
public static final field _all I
public static final field submitted I
public static field _all I
public static field submitted I
public fun <init> ()V
}

public class com/skydoves/bindables/BR {
public static final field _all I
public static final field submitted I
public static field _all I
public static field submitted I
public fun <init> ()V
}

Expand Down
2 changes: 1 addition & 1 deletion bindables/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import com.skydoves.bindables.Configuration

plugins {
id(libs.plugins.android.application.get().pluginId)
id(libs.plugins.android.library.get().pluginId)
id(libs.plugins.kotlin.android.get().pluginId)
id(libs.plugins.kotlin.kapt.get().pluginId)
id(libs.plugins.kotlin.parcelize.get().pluginId)
Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ plugins {
alias(libs.plugins.kotlin.binary.compatibility) apply false
alias(libs.plugins.hilt.plugin) apply false
alias(libs.plugins.nexus.plugin) apply false
alias(libs.plugins.kotlin.kapt)
alias(libs.plugins.kotlin.kapt) apply false
alias(libs.plugins.spotless)
alias(libs.plugins.dokka)
}
Expand Down

0 comments on commit cffabe0

Please sign in to comment.