Skip to content

Instantly share code, notes, and snippets.

View sme-shyl001's full-sized avatar
🐵

Roman Shylo sme-shyl001

🐵
View GitHub Profile
@sme-shyl001
sme-shyl001 / printHashKey.kt
Created September 20, 2023 07:56
Signature hash key
private fun printHashKey() {
try {
val info: PackageInfo =
requireActivity().packageManager.getPackageInfo(
requireActivity().packageName,
// "com.sme.ap.prod",
PackageManager.GET_SIGNATURES
)
for (signature in info.signatures) {
val md = MessageDigest.getInstance("SHA")
@sme-shyl001
sme-shyl001 / FavoriteItemsListAdapter.kt
Last active August 30, 2023 09:36
Adapter for switching items
class FavoriteItemsListAdapter(
private val activity: Activity,
private val listener: (section: FavoriteSection) -> Unit
) : ListAdapter<FavoriteItem, FavoriteItemsListAdapter.FavoriteViewHolder>(DiffCallback()) {
private var recyclerView: RecyclerView? = null
override fun onAttachedToRecyclerView(recyclerView: RecyclerView) {
super.onAttachedToRecyclerView(recyclerView)
this.recyclerView = recyclerView