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 rx.android.observables; | |
import rx.Observable; | |
import rx.Observable.OnSubscribe; | |
import rx.Subscriber; | |
import rx.android.subscriptions.AndroidSubscriptions; | |
import rx.functions.Action0; | |
import android.content.BroadcastReceiver; | |
import android.content.Context; | |
import android.content.Intent; |
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 com.google.android.gms.tasks.Task; | |
import com.google.firebase.database.ChildEventListener; | |
import com.google.firebase.database.DataSnapshot; | |
import com.google.firebase.database.DatabaseError; | |
import com.google.firebase.database.DatabaseReference; | |
import com.google.firebase.database.Query; | |
import com.google.firebase.database.ValueEventListener; | |
import rx.Observable; | |
import rx.Subscriber; |
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
import android.text.SpannableStringBuilder; | |
import java.util.ArrayDeque; | |
import java.util.Deque; | |
import static android.text.Spanned.SPAN_INCLUSIVE_EXCLUSIVE; | |
/** A {@link SpannableStringBuilder} wrapper whose API doesn't make me want to stab my eyes out. */ | |
public class Truss { | |
private final SpannableStringBuilder builder; | |
private final Deque<Span> stack; |
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
<?xml version="1.0" encoding="utf-8"?> | |
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" > | |
<!-- Drop Shadow Stack --> | |
<item> | |
<shape> | |
<padding | |
android:bottom="1dp" | |
android:left="1dp" | |
android:right="1dp" |
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
sealed class Failure { | |
/*Network Error*/ | |
class NetworkConnection(var additionalData: Any? = null) : Failure() | |
/*Exception*/ | |
class Exception(var additionalData: Any? = null) : Failure() | |
/** | |
* Although the HTTP standard specifies "unauthorized", | |
* semantically this response means "unauthenticated". |