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
* { | |
font-size: 12pt; | |
font-family: monospace; | |
font-weight: normal; | |
font-style: normal; | |
text-decoration: none; | |
color: black; | |
cursor: default; | |
} |
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
String apiKey = BuildConfig.API_KEY |
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
apply plugin: 'java' | |
sourceCompatibility = JavaVersion.VERSION_1_7 | |
targetCompatibility = JavaVersion.VERSION_1_7 | |
def logger = new com.android.build.gradle.internal.LoggerWrapper(project.logger) | |
def sdkHandler = new com.android.build.gradle.internal.SdkHandler(project, logger) | |
for (File file : sdkHandler.sdkLoader.repositories) { | |
project.repositories.maven { | |
url = file.toURI() |
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
/** | |
* An enhanced {@code CheckBox} that differentiates between user clicks and | |
* programmatic clicks. In particular, the {@code OnCheckedChangeListener} is | |
* <strong>not</strong> triggered when the state of the checkbox is changed | |
* programmatically. | |
* | |
*/ | |
public class EnhancedCheckBox extends CheckBox implements ProgrammaticallyCheckable{ | |
private CompoundButton.OnCheckedChangeListener mListener = null; | |
public EnhancedCheckBox(Context 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
/** | |
* <p> | |
* An {@code ArrayAdapter} that also knows how to save and restore its state. | |
* Basically all it does is save/restore the array of objects being managed by | |
* the Adapter. | |
* </p> | |
* | |
* <p> | |
* Note that this only saves the items and not things like checked item | |
* positions. Those belong to the {@link ListView} itself. Consider using |
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.github.curioustechizen.safereg; | |
import android.content.BroadcastReceiver; | |
import android.content.Context; | |
import android.content.Intent; | |
import android.content.IntentFilter; | |
import android.support.v4.util.ArrayMap; | |
/** | |
* Helper class to keep track of what {@code BroadcastReceiver}s have been |
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 static org.fest.reflect.core.Reflection.*; | |
import android.net.nsd.NsdServiceInfo; | |
public class ReflectionUtils { | |
public static int extractTxtRecordFromServiceInfo(NsdServiceInfo serviceInfo) { | |
Class<?> dnsSdTxtRecordType = type("android.net.nsd.DnsSdTxtRecord") | |
.load(); | |
Object txtRecord = | |
method("getTxtRecord") | |
.withReturnType(dnsSdTxtRecordType) |
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.annotation.TargetApi; | |
import android.os.AsyncTask; | |
import android.os.Build; | |
public class AsyncTaskUtils { | |
@TargetApi(Build.VERSION_CODES.HONEYCOMB) | |
public static <P> void executeAsyncTaskInParallel( | |
AsyncTask<P, ?, ?> asyncTask, P... params) { | |
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { |
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 in.curtech.android.common; | |
import android.content.BroadcastReceiver; | |
/** | |
* Extension of {@code BroadcastReceiver} meant to be used in conjunction with | |
* {@link OrderEnabledLocalBroadcastManager} | |
* | |
* @author Kiran Rao | |
*/ |
NewerOlder