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
# Copyright (c) 2013 Embark Mobile | |
# Modified to work with Eclipse HIPP instance by David Carver | |
# Licensed under the MIT License. | |
# https://github.com/embarkmobile/android-sdk-installer | |
set +e | |
#detecting os | |
os=linux | |
if [[ `uname` == 'Darwin' ]]; then |
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
/** | |
* Takes a value in pixels and converts it to a dpi value. It adjusts | |
* the dpi size based on the screen density that is returned by | |
* android. | |
* | |
* @param originalHeight | |
* @param context The activity context | |
* @return | |
*/ | |
public static int getDPI(int pixelsize, Activity context) { |
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
<profiles> | |
<profile> | |
<id>release-profile</id> | |
<properties> | |
<p2repo-dir>${basedir}/target/deployed-repository</p2repo-dir> | |
<buildNumber>${project.version}.${maven.build.timestamp}</buildNumber> | |
</properties> | |
<build> | |
<plugins> | |
<plugin> |
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
<?xml version="1.0" encoding="ISO-8859-1"?> | |
<opml version="2.0"> | |
<head> | |
<title>TWiT.tv</title> | |
<dateModified>Thu, 25 Apr 2013 23:35:52 GMT</dateModified> | |
</head> | |
<body> | |
<outline text="TWiT.tv"> | |
<outline text="Tech News Today" type="rss" xmlUrl="http://feeds.twit.tv/tnt_video_hd" /> | |
<outline text="This Week in Tech" type="rss" xmlUrl="http://feeds.twit.tv/twit_video_hd" /> |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<project> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>com.github.kingargyle</groupId> | |
<artifactId>p2-orbit-repo-example</artifactId> | |
<version>1.0.0</version> | |
<packaging>pom</packaging> | |
<build> |
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
/* | |
* Verifies that an activities runOnUiThread method is called and that | |
* appropriate class is called. In most cases we don't care about | |
* actually executing the runOnUiThread, just that it got called. | |
* By mocking out the Activity, we can use Mockito's verify method to | |
* make sure the method was called, with the expected Runnable class implementation | |
* passed into it. | |
* | |
* By doing this we avoid having to pause Robolectrics's UIScheduler and BackgroundSchedulers | |
* and then kick off the task. Since in this case it isn't actually necessary to run the code as it |
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 java.io.ByteArrayOutputStream; | |
import java.io.PrintStream; | |
import org.junit.rules.ExternalResource; | |
import org.robolectric.shadows.ShadowLog; | |
public class RobolectricLoggingRule extends ExternalResource { | |
PrintStream loggingStream; | |
ByteArrayOutputStream loggingOutputStream; | |
PrintStream defaultStream; |
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.Intent; | |
import android.os.Bundle; | |
import android.support.v4.app.Fragment; | |
import java.util.ArrayList; | |
import java.util.HashMap; | |
import java.util.List; | |
import java.util.Map; | |
import org.robolectric.annotation.Implementation; | |
import org.robolectric.annotation.Implements; | |
import org.robolectric.shadows.ShadowApplication; |
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.support.design.widget.TextInputLayout; | |
import org.robolectric.annotation.Implements; | |
import org.robolectric.annotation.RealObject; | |
import org.robolectric.shadows.ShadowViewGroup; | |
@Implements(TextInputLayout.class) | |
public class ShadowTextInputLayout extends ShadowViewGroup { | |
@RealObject private TextInputLayout realTextInputLayout; |
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 Activity getActivity() { | |
Context context = getContext(); | |
while (context instanceof ContextWrapper) { | |
if (context instanceof Activity) { | |
return (Activity)context; | |
} | |
context = ((ContextWrapper)context).getBaseContext(); | |
} | |
return null; | |
} |