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
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
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() |
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
@Test | |
public void testLaunchActivity() { | |
onView(withId(R.id.home_camera_button)).check(matches(withText("Camera"))); | |
onView(withId(R.id.home_gallery_button)).check(matches(withText("Gallery"))); | |
onView(withId(R.id.home_inspire_button)).check(matches(withText("Inspire"))); | |
} |
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
imageView.setOnTouchListener(new View.OnTouchListener() { | |
@Override | |
public boolean onTouch(View view, MotionEvent event) { | |
originalImageView.setVisibility(event.getAction() == MotionEvent.ACTION_DOWN ? | |
View.VISIBLE : View.GONE); | |
return true; | |
} | |
}); |
NewerOlder