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.skily.gps; | |
import android.os.Handler; | |
import java.util.concurrent.TimeUnit; | |
import timber.log.Timber; | |
public class AndroidTimer { | |
long mTrackedTime = 0; | |
long mLastUpdateTime = 0; |
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
abstract public class ListFragment<ViewHolderType extends RecyclerView.ViewHolder, ModelType> extends BaseFragment { | |
/** | |
* Views | |
*/ | |
@InjectView(R.id.list) RecyclerView mRecyclerView; | |
@InjectView(R.id.progress_view) ProgressBar mProgressView; | |
@InjectView(R.id.empty) ViewStub mEmpty; | |
@InjectView(R.id.error_view) ErrorView mErrorView; | |
/** |
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
/** | |
* Show the activity over the lockscreen and wake up the device. If you launched the app manually | |
* both of these conditions are already true. If you deployed from the IDE, however, this will | |
* save you from hundreds of power button presses and pattern swiping per day! | |
*/ | |
public static void riseAndShine(Activity activity) { | |
activity.getWindow().addFlags(FLAG_SHOW_WHEN_LOCKED); | |
PowerManager power = (PowerManager) activity.getSystemService(POWER_SERVICE); | |
PowerManager.WakeLock lock = |
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.smartsoft.library.adapters; | |
import android.app.Activity; | |
import android.view.View; | |
import android.view.ViewGroup; | |
import android.widget.BaseAdapter; | |
import com.google.android.gms.ads.AdRequest; | |
import com.google.android.gms.ads.AdSize; | |
import com.google.android.gms.ads.AdView; |
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 org.joda.time.DateTime; | |
import org.joda.time.DateTimeZone; | |
public class WCFDateTimeParser { | |
/** | |
* <p>WCF services supply Dates over JSON in a strange format. This method | |
* takes a WCF-formatted Date string and parses it into a JodaTime DateTime | |
* object. Assumes valid input matching a format described below.</p> | |
* |
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
public static String getMD5Hash(String password) { | |
try { | |
final MessageDigest messageDigest = MessageDigest.getInstance(MD5); | |
messageDigest.reset(); | |
messageDigest.update(password.getBytes(UTF_8)); | |
final byte[] resultByte = messageDigest.digest(); | |
final String result = new String(Hex.encodeHex(resultByte)); |