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
public static void setFirstLineBold(TextView tv) { | |
String txt = tv.getText().toString(); | |
Spannable span = new SpannableString(txt); | |
int end = txt.indexOf('\n'); | |
if (end == -1) { | |
end = txt.length(); | |
} | |
span.setSpan(new StyleSpan(android.graphics.Typeface.BOLD), 0, end, |
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
package com.sourcerebels.test.mongodb; | |
import java.net.UnknownHostException; | |
import com.mongodb.DB; | |
import com.mongodb.DBCollection; | |
import com.mongodb.DBObject; | |
import com.mongodb.MongoClient; | |
public class App |
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
From: | |
http://www.lwjgl.org/wiki/index.php?title=Setting_Up_LWJGL_with_Maven |
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
<dependency> | |
<groupId>org.apache.httpcomponents</groupId> | |
<artifactId>httpclient</artifactId> | |
<version>4.1</version> | |
</dependency> | |
<dependency> | |
<groupId>org.apache.httpcomponents</groupId> | |
<artifactId>httpmime</artifactId> | |
<version>4.1</version> | |
</dependency> |
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
@Test | |
public void shouldStartSomeActivityWhenSomeButtonPressed() { | |
someButton.performClick(); | |
assertActivityStarted(SomeActivity.class) | |
} | |
private void assertActivityStarted(Class<? extends Activity> clazz) { | |
ShadowActivity shadowActivity = shadowOf(activity); | |
Intent startedIntent = shadowActivity.getNextStartedActivity(); | |
ShadowIntent shadowIntent = shadowOf(startedIntent); |
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
<LinearLayout | |
style="@style/OfficeDetail" | |
android:focusable="true" | |
android:focusableInTouchMode="true" | |
android:orientation="vertical" > | |
<!-- Widgets formulario (EditText, ...) --> | |
</LinearLayout> |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>com.sourcerebels</groupId> | |
<artifactId>android-project</artifactId> | |
<version>0.1.0-SNAPSHOT</version> | |
<packaging>apk</packaging> | |
<name>Android Template Project</name> |
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
//Father.java | |
package test; | |
public class Father { | |
protected void hello() { | |
System.out.println("hello"); | |
} | |
} | |
//Son.java | |
package test; |
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
private void configureWebView() { | |
webView = (WebView) findViewById(R.id.webview); | |
WebSettings settings = webView.getSettings(); | |
settings.setJavaScriptEnabled(true); | |
settings.setDomStorageEnabled(true); | |
settings.setGeolocationEnabled(true); | |
settings.setJavaScriptCanOpenWindowsAutomatically(true); | |
settings.setUseWideViewPort(true); | |
settings.setAppCacheEnabled(true); | |
settings.setDatabaseEnabled(true); |
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
#!/bin/bash | |
# | |
# Run inside Maven project directory. | |
# | |
REVISION=$1 | |
JAR=${ANDROID_HOME}/add-ons/addon-google_apis-google-${REVISION}/libs/maps.jar | |
VERSION=${REVISION}_r1 | |
echo "Revision: $REVISION" |