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
interface CryptographyManager { | |
/** | |
* This method first gets or generates an instance of SecretKey and then initializes the Cipher | |
* with the key. The secret key uses [ENCRYPT_MODE][Cipher.ENCRYPT_MODE] is used. | |
*/ | |
fun getInitializedCipherForEncryption(keyName: String): Cipher | |
/** | |
* This method first gets or generates an instance of SecretKey and then initializes the Cipher |
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
Observable.just("Will") | |
.observeOn(Schedulers.io()) | |
.flatMap({ name -> | |
updateUserName.execute(name) //returns another Observable<ApiResult> after calling the API | |
}, { | |
//this is executed after resolving the last observable emitted, so the result is ready. | |
name: String, apiResult: ApiResult -> Pair(name, apiResult) | |
}) | |
.subscribe({ 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
// status bar height | |
int statusBarHeight = 0; | |
int resourceId = getResources().getIdentifier("status_bar_height", "dimen", "android"); | |
if (resourceId > 0) { | |
statusBarHeight = getResources().getDimensionPixelSize(resourceId); | |
} | |
// action bar height | |
int actionBarHeight = 0; | |
final TypedArray styledAttributes = getActivity().getTheme().obtainStyledAttributes( |