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
/** | |
* A one color image. | |
* @param width | |
* @param height | |
* @param color | |
* @return A one color image with the given width and height. | |
*/ | |
public static Bitmap createImage(int width, int height, int color) { | |
Bitmap bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888); | |
Canvas canvas = new Canvas(bitmap); |
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
package co.ortatech.showandhide.ui.activity; | |
import android.app.Activity; | |
import android.app.Instrumentation; | |
import android.content.Intent; | |
import android.net.Uri; | |
import android.support.test.InstrumentationRegistry; | |
import android.support.test.espresso.intent.Intents; | |
import android.support.test.espresso.intent.rule.IntentsTestRule; | |
import android.support.test.runner.AndroidJUnit4; |
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
// Make an image all of one size, in whatever color. | |
+ (UIImage *)createTestImageWithWidth:(CGFloat)width | |
height:(CGFloat)height | |
color:(UIColor *)color { | |
CGRect rect = CGRectMake(0, 0, width, height); | |
UIGraphicsBeginImageContext(rect.size); | |
[color set]; | |
UIRectFill(rect); | |
UIImage *testImage = UIGraphicsGetImageFromCurrentImageContext(); | |
UIGraphicsEndImageContext(); |
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
package co.ortatech.showandhide.service; | |
import android.app.IntentService; | |
import android.content.Intent; | |
import android.support.v4.content.LocalBroadcastManager; | |
import javax.inject.Inject; | |
import co.ortatech.showandhide.application.ShowAndHideApplication; |
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 static class HomeActivityTestRule extends IntentsTestRule { | |
private HomeActivityTestRule() { | |
super(HomeActivity.class); | |
} | |
@Override public void beforeActivityLaunched() { | |
Instrumentation instrumentation = InstrumentationRegistry.getInstrumentation(); | |
ShowAndHideApplication app = | |
(ShowAndHideApplication) instrumentation.getTargetContext().getApplicationContext(); | |
ShowAndHideTestComponent component = DaggerShowAndHideTestComponent.builder() |
NewerOlder