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 io.leftshift.app.model; | |
import com.activeandroid.Model; | |
import com.activeandroid.annotation.Column; | |
import com.activeandroid.annotation.Table; | |
import com.activeandroid.query.Delete; | |
import com.activeandroid.query.Select; | |
@Table(name = "Authentication") | |
public class Authentication extends Model { |
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
retrofitService.getAccessToken() | |
/* AuthenticationResponse is the return type of retrofitService.getAccessToken() | |
* Observable<ResponseBody> is the return type of retrofitService.getRecords(), I'm using retrofit response body here | |
*/ | |
.flatMap(new Func1<AuthenticationResponse, Observable<ResponseBody>>() { | |
@Override | |
public Observable<ResponseBody> call(AuthenticationResponse authenticationResponse) { | |
String accessToken = authenticationResponse.getData().getAccessToken(); | |
String refreshToken = authenticationResponse.getData().getRefreshToken(); | |
Authentication.saveDetails(accessToken, refreshToken); |
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 | |
//Get all branches from remote and track them locally | |
for remote in `git branch -r`; do git branch --track ${remote#origin/} $remote; done | |
//Fetch all branches | |
git fetch --all | |
//Pull all branches | |
git pull --all |
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/sh | |
# The MIT License (MIT) | |
# Copyright (c) 2014 Debjeet Biswas | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
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"?> | |
<resources> | |
<declare-styleable name="CircularProgressView"> | |
<attr name="cpv__backgroundColor" format="color" /> | |
<attr name="cpv__backgroundColorPressed" format="color" /> | |
<attr name="cpv__animationTime" format="float" /> | |
<attr name="cpv__insideRadius" format="dimension" /> | |
<attr name="cpv__progressWidth" format="dimension" /> | |
</declare-styleable> | |
</resources> |
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.doomonafireball.samples.android.widget; | |
import com.doomonafireball.samples.android.R; | |
import android.content.Context; | |
import android.content.res.Resources; | |
import android.content.res.TypedArray; | |
import android.graphics.Canvas; | |
import android.graphics.Color; | |
import android.graphics.Paint; |
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
.DS_Store | |
# built application files | |
*.apk | |
*.ap_ | |
# files for the dex VM | |
*.dex | |
# Java class files |
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 io.leftshift.app; | |
import com.crashlytics.android.Crashlytics; | |
import timber.log.Timber; | |
/** | |
* A logging implementation which reports 'info', 'warning', and 'error' logs to Crashlytics. | |
*/ | |
public class CrashlyticsTree extends Timber.HollowTree { | |
@Override public void v(String message, Object... args) { |
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 io.leftshift.utilities; | |
import java.io.ByteArrayOutputStream; | |
import java.io.IOException; | |
import java.io.UnsupportedEncodingException; | |
import java.net.URLDecoder; | |
import java.util.HashMap; | |
import java.util.Map; | |
import org.apache.http.HttpResponse; |
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
put card.xml in your drawables directory, put colors.xml in your values directory or add the colors to your colors.xml file. | |
set the background of a view to card, | |
as you can see in card.xml the drawable handles the card margin, so you don't have to add a margin to your view | |
``` xml | |
<View | |
android:layout_width="fill_parent" |
NewerOlder