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
/** | |
* ItemDecoration implementation for equal padding between the list items except first and last items. | |
* @author Ryan Amaral | |
* @version 1.0 | |
*/ | |
public class PaddingItemDecoration extends RecyclerView.ItemDecoration { | |
private int mPaddingPx; | |
private int mPaddingEdgesPx; |
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
private val userId = MutableLiveData<String>() | |
val userDetails = userId.switchMap { | |
userRepo.getUser(it) | |
} | |
val userFullName = userDetails.map { | |
getFullName(it.firstName, it.lastName) | |
} |
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
/* We create an interface with one method */ | |
public interface TextWatcherWithInstance { | |
void onTextChanged(EditText editText, CharSequence s, int start, int before, int count); | |
} | |
/* We create a custom class called MultiTextWatcher. | |
* And pass the interface here | |
*/ |
NewerOlder