-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
64 changed files
with
384 additions
and
104 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
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
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
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
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
53 changes: 53 additions & 0 deletions
53
app/src/main/java/com/fundito/fundito/presentation/login/LoginGuidePagerAdapter.kt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
package com.fundito.fundito.presentation.login | ||
|
||
import android.view.LayoutInflater | ||
import android.view.ViewGroup | ||
import androidx.annotation.DrawableRes | ||
import androidx.databinding.library.baseAdapters.BR | ||
import androidx.recyclerview.widget.DiffUtil | ||
import androidx.recyclerview.widget.ListAdapter | ||
import androidx.recyclerview.widget.RecyclerView | ||
import com.fundito.fundito.databinding.ItemLoginGuideBinding | ||
|
||
/** | ||
* Created by mj on 03, January, 2020 | ||
*/ | ||
class LoginGuidePagerAdapter : ListAdapter<Triple<String, String, @DrawableRes Int>, LoginGuidePagerAdapter.LoginGuidePagerHolder>(DIFF) { | ||
|
||
companion object { | ||
private val DIFF = object : DiffUtil.ItemCallback<Triple<String,String,@androidx.annotation.DrawableRes Int>>() { | ||
override fun areItemsTheSame(oldItem: Triple<String,String, Int>, newItem: Triple<String,String, Int>): Boolean { | ||
return oldItem == newItem | ||
} | ||
|
||
override fun areContentsTheSame(oldItem: Triple<String,String, Int>, newItem: Triple<String,String, Int>): Boolean { | ||
return oldItem == newItem | ||
} | ||
} | ||
} | ||
|
||
fun submitItems(items : List<Triple<String,String, Int>>) { | ||
submitList(items) | ||
} | ||
|
||
|
||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): LoginGuidePagerHolder { | ||
val inflater = LayoutInflater.from(parent.context) | ||
val binding = ItemLoginGuideBinding.inflate(inflater, parent, false) | ||
|
||
return LoginGuidePagerHolder(binding) | ||
} | ||
|
||
|
||
override fun onBindViewHolder(holder: LoginGuidePagerHolder, position: Int) = holder.bind(getItem(position)) | ||
|
||
|
||
inner class LoginGuidePagerHolder(private val binding: ItemLoginGuideBinding) : RecyclerView.ViewHolder(binding.root) { | ||
fun bind(item: Triple<String,String, Int>) { | ||
binding.setVariable(BR.info1, item.first) | ||
binding.setVariable(BR.info2, item.second) | ||
binding.setVariable(BR.image, item.third) | ||
binding.executePendingBindings() | ||
} | ||
} | ||
} |
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
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
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
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
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
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
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
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
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
Oops, something went wrong.