For example, you want to set 40% alpha transparence to #000000
(black color), you need to add 66
like this #66000000
.
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
// Error Codes for SignUp | |
ERROR_OPERATION_NOT_ALLOWED` - Indicates that Anonymous accounts are not enabled. | |
ERROR_WEAK_PASSWORD - If the password is not strong enough. | |
ERROR_INVALID_EMAIL` - If the email address is malformed. | |
ERROR_EMAIL_ALREADY_IN_USE - If the email is already in use by a different account. | |
ERROR_INVALID_CREDENTIAL` - If the [email] address is malformed. | |
// sending password reset email | |
ERROR_INVALID_EMAIL` - If the [email] address is malformed. |
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 | |
*/ |
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
// Dagger 1 example | |
@Module( | |
complete = false, | |
library = true | |
) | |
public final class ApiModule { | |
@Provides | |
@Singleton | |
Retrofit provideRetrofit(Gson gson, Application app) { | |
return new Retrofit.Builder() |
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
import android.content.Context; | |
import android.content.Intent; | |
import android.support.v4.content.WakefulBroadcastReceiver; | |
import android.util.Log; | |
/** | |
* This is called whenever app receives notification | |
* in background/foreground state so you can | |
* apply logic for background task, but still Firebase notification | |
* will be shown in notification tray |
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
Nav flow is: A => B => C => A with results from C | |
If you're using fragments please note that "onActivityResult" will be called according to where "startActivityForResult" is called (method "startActivityForResult" is available in both, activity and fragment) | |
ActivityA | |
startActivityForResult(intentB, 22); | |
ActivityB | |
intentC.addFlags(Intent.FLAG_ACTIVITY_FORWARD_RESULT); | |
startActivity(intentC); | |
finish(); |
NewerOlder