This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
language: android | |
jdk: oraclejdk8 | |
branches: | |
only: | |
- develop #or the branch you want to observe | |
notifications: | |
slack: #your_slack_id |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apply plugin: 'com.android.library' | |
apply plugin: 'kotlin-android' | |
apply plugin: 'kotlin-kapt' | |
apply plugin: 'kotlin-android-extensions' | |
android { | |
compileSdkVersion 29 | |
buildToolsVersion "29.0.1" | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apply from: "$rootProject.projectDir/common.gradle" | |
dependencies { | |
def acceptanceTesting = rootProject.ext.acceptanceTesting | |
testImplementation project(path: ':core') | |
androidTestImplementation 'net.rafaeltoledo.okir:library:0.0.1@aar' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val m : (Int, Int) -> Unit = {x, y -> | |
print("::::$x $y") | |
} | |
CoroutineScope(Dispatchers.Default).launch { | |
print("Corutine 1 $this\n") | |
val mm = this | |
withContext(Dispatchers.IO) { | |
print("Corutine 2 $this\n") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ProductDiffUtilCallback( | |
private val oldProducts: List<ViewProduct>, | |
private val newProducts: List<ViewProduct> | |
) : DiffUtil.Callback() { | |
override fun areItemsTheSame(oldItemPosition: Int, newItemPosition: Int): Boolean = | |
oldProducts[oldItemPosition].id == newProducts[newItemPosition].id | |
override fun getOldListSize(): Int = oldProducts.size |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data class ViewProduct( | |
val id: String, | |
val name: String, | |
val description: String, | |
val quantity: Int | |
) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
override fun getChangePayload(oldItemPosition: Int, newItemPosition: Int): Any? { | |
val oldItem = oldProducts[oldItemPosition] | |
val newItem = newProducts[newItemPosition] | |
if (oldItem.quantityInCart != newItem.quantityInCart) { | |
return UPDATE_QUANTITY | |
} | |
return null | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ProductAdapter( | |
private val products: ArrayList<ViewProduct> | |
) : RecyclerView.Adapter<ProductViewHolder>() { | |
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ProductViewHolder { | |
return ProductViewHolder( | |
LayoutInflater.from(parent.context).inflate(R.layout.product_item, parent, false) | |
) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
override fun onBindViewHolder( | |
holder: ProductViewHolder, | |
position: Int, | |
payloads: MutableList | |
) { | |
if (payloads.isEmpty()) { | |
onBindViewHolder(holder, position) | |
} else { | |
for (data in payloads) { | |
when (data as Int) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fastlane_version "2.68.0" | |
default_platform :android | |
platform :android do | |
lane :firebase do | |
build_android_app(task: "assembleDebug") | |
firebase_app_distribution( |
OlderNewer