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
/** | |
* Equivalent to jquery.extend : copy non null properties from origin to dest if exist | |
* | |
* @param orig | |
* @param dest | |
*/ | |
public static void extend( Object orig, Object dest ) | |
{ | |
if ( orig == null || dest == null ) | |
{ |
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 something; | |
import java.util.regex.Matcher; | |
import java.util.regex.Pattern; | |
public class PlaceHolderConverter | |
{ | |
public Pattern lookForVar; |
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
Date.metaClass.round = { String period -> | |
delegate.clearTime() | |
GregorianCalendar gc = new GregorianCalendar() | |
gc.time = delegate | |
switch (period) { | |
case 'week': | |
def dayToSet = 2 //monday | |
def dayWeek = gc.get(Calendar.DAY_OF_WEEK) | |
def distance = dayWeek == 1 ? -6 : dayToSet - dayWeek |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
for (StackTraceElement el : Thread.currentThread().getStackTrace()) { | |
logger.e("stacktrace %s %s", el.getClassName(), el.getMethodName()); | |
} |
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
buildscript { | |
repositories { | |
mavenCentral() | |
maven { | |
url "https://oss.sonatype.org/content/repositories/snapshots/" | |
} | |
} | |
dependencies { | |
classpath 'com.novoda:gradle-android-test-plugin:0.9.7-SNAPSHOT' | |
} |
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 com.comalia.gesicamobile.test; | |
import com.actionbarsherlock.app.ActionBar; | |
import org.fest.assertions.api.ANDROID; | |
public class MyANDROID extends ANDROID { | |
public static SupportActionBarAssert assertThat(ActionBar actionBar) { | |
return new SupportActionBarAssert(actionBar); |
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 com.comalia.gesicamobile.manager.widget; | |
import android.content.Context; | |
import android.content.res.TypedArray; | |
import android.text.TextUtils; | |
import android.util.AttributeSet; | |
import android.util.Log; | |
import android.widget.TextView; | |
import com.comalia.gesicamobile.manager.R; |
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
int titleId = getResources().getIdentifier("action_bar_title", "id", | |
"android"); | |
TextView yourTextView = (TextView) findViewById(titleId); | |
yourTextView.setTypeface(TypefaceUtil.getTypeFace(this, "fonts/Roboto-Light.ttf")); | |
yourTextView.setTextAppearance(this, R.style.TextAppearance_GesicaManager_Title); |
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 com.comalia.gesicamobile.util; | |
import android.content.Context; | |
import android.content.Intent; | |
import android.content.pm.PackageManager; | |
import android.content.res.Resources; | |
import android.net.Uri; | |
import android.os.Looper; | |
import android.util.DisplayMetrics; | |
import android.util.TypedValue; |
OlderNewer