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
class ElapsedTimeLogger(private val tag: String = ElapsedTimeLogger::class.simpleName!!) { | |
private var startTime = SystemClock.elapsedRealtime() | |
/** | |
* Logs the number of milliseconds that have elapsed since this [ElapsedTimeLogger] was initialised. | |
* | |
* The logs are sent to log output (i.e. Logcat) as a debug message. | |
*/ | |
fun logElapsedTime() { |
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
/** | |
* Shows a {@link Toast} which is positioned to the left of a given {@link View}. | |
* The message in the {@link Toast} is the content description of the {@link View}. | |
* <p> | |
* Much of the code in this method is inspired by <a href="https://stackoverflow.com/a/21026866/1071320">this</a> StackOverflow answer. | |
*/ | |
private void showContentDescriptionOfViewAsToast(View view) { | |
// toasts are positioned relative to the decor view and views relative to their parents; | |
// we have to gather additional data to have a common coordinate system | |
Rect rect = new Rect(); |
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 <Foundation/Foundation.h> | |
@interface MJRSecKeyRefProvider : NSObject | |
/** | |
* @param tag the identifier with which to save keys in the Keychain. | |
*/ | |
- (instancetype)initWithTag:(NSString *)tag; | |
/** |
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
// | |
// Class modified from this GitHub repository: | |
// https://github.com/jeremangnr/JNKeychain | |
// | |
#import <Foundation/Foundation.h> | |
@interface MJRKeychainStorage : NSObject | |
/** |