This file contains hidden or 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
//take two Integers, a and b, and give me the result of adding them as an Integer | |
fun add(a: Int, b: Int): Int { | |
return a + b | |
} | |
//The computer begins reading at the line below this comment | |
fun main() { | |
val result = add(1, 2) | |
println(result) | |
} |
This file contains hidden or 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
//use this in your Recyclerview or whereever for asynchornous image loading | |
Glide.with(holder.itemView.context) | |
.load(avatarUrl) | |
.centerCrop() | |
.placeholder( | |
CircularProgressDrawable(holder.itemView.context).apply { | |
setColorSchemeColors( | |
ContextCompat.getColor(holder.itemView.context, R.color.colorPrimary) | |
) |
This file contains hidden or 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
public class TodoAdapter extends RecyclerView.Adapter<TodoAdapter.CustomViewHolder> { | |
private LayoutInflater inflater; | |
private List<Todo> listData; | |
private ItemClickCallback itemClickCallback; | |
public TodoAdapter (List<Todo> listData, Context c){ | |
inflater = LayoutInflater.from(c); | |
this.listData = listData; | |
} |