(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| fun BriteDatabase.createQuery(query: SqlDelightStatement) = createQuery(query.tables, query.statement, *query.args) | |
| inline fun <T: SqlDelightCompiledStatement> BriteDatabase.bindAndExecute(compiledStatement: T, bind: T.() -> Unit): Long { | |
| synchronized(compiledStatement) { | |
| compiledStatement.bind() | |
| return when (compiledStatement) { | |
| is SqlDelightCompiledStatement.Insert -> { | |
| executeInsert(compiledStatement.table, compiledStatement.program) | |
| } | |
| is SqlDelightCompiledStatement.Update -> { |
| private ObjectAnimator animateRegularProgress(int finalProgress) { | |
| ObjectAnimator animation = ObjectAnimator.ofInt(regularProgressBar, PROPERTY_NAME, 0, finalProgress); | |
| animation.setDuration(ANIM_PROGRESS); | |
| animation.setInterpolator(new LinearInterpolator()); | |
| return animation; | |
| } | |
| private void animateTextProgress(float end, float total, ObjectAnimator barAnimationToCoupleTo) { |
| /* | |
| * Copyright 2014 Johannes Homeier | |
| * | |
| * Licensed under the Apache License, Version 2.0 (the "License"); | |
| * you may not use this file except in compliance with the License. | |
| * You may obtain a copy of the License at | |
| * | |
| * http://www.apache.org/licenses/LICENSE-2.0 | |
| * | |
| * Unless required by applicable law or agreed to in writing, software |
| /* | |
| * Copyright (C) 2014 The Android Open Source Project | |
| * | |
| * Licensed under the Apache License, Version 2.0 (the "License"); | |
| * you may not use this file except in compliance with the License. | |
| * You may obtain a copy of the License at | |
| * | |
| * http://www.apache.org/licenses/LICENSE-2.0 | |
| * | |
| * Unless required by applicable law or agreed to in writing, software |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| 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; |
| import com.google.gson.Gson; | |
| import com.google.gson.JsonSyntaxException; | |
| import com.android.volley.AuthFailureError; | |
| import com.android.volley.NetworkResponse; | |
| import com.android.volley.ParseError; | |
| import com.android.volley.Request; | |
| import com.android.volley.Response; | |
| import com.android.volley.Response.ErrorListener; | |
| import com.android.volley.Response.Listener; |
| CONNECTION='wireless' | |
| DESCRIPTION='' | |
| INTERFACE='wlp3s0' | |
| SECURITY='wpa-configsection' | |
| IP='dhcp' | |
| CONFIGSECTION=' | |
| ssid="GTwifi" | |
| key_mgmt=WPA-EAP | |
| proto=RSN | |
| eap=PEAP |