(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 Cocoa | |
struct Person { | |
var name: String = "John" | |
var age: Int = 50 | |
var dutch: Bool = false | |
var address: Address? = Address(street: "Market St.") | |
} | |
struct Address { |
AppCompat-v7:21 provides a very useful way of dealing with pressed/focused/activated states maintaining backwards compatibility downto API-7, but there's a small issue (big for some) with the default selectableItemBackground: It uses some PNGs and/or default values for API<21. | |
The main reason is that android drawable resource definitions (prior API 21) CANNOT use theme attributes at all, so there's no way of making something like: | |
<shape android:shape="rectangle"> | |
<solid android:color="?attr/colorControlHighlight" /> | |
</shape> | |
For this, I've put this simple mockup on how to give your app better drawables that the appcompat defaults. |
import Foundation | |
extension String | |
{ | |
var length: Int { | |
get { | |
return countElements(self) | |
} | |
} | |
(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.
Here is a high level overview for what you need to do to get most of an Android environment setup and maintained.
Prerequisites (for Homebrew at a minimum, lots of other tools need these too):
xcode-select --install
will prompt up a dialog)Install Homebrew:
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
package com.pommedeterresautee.rxtest; | |
import android.content.Intent; | |
import android.os.Bundle; | |
import android.app.Activity; | |
import android.view.Menu; | |
import android.widget.TextView; | |
import rx.Observer; |
import android.util.SparseArray; | |
import com.google.gson.Gson; | |
import com.google.gson.reflect.TypeToken; | |
import java.lang.reflect.Type; | |
public class Main { | |
public static class MyCustomClass { | |
public int a; |
#Intro
Kotlin is a new programming language for the JVM. It produces Java bytecode, supports Android and generates JavaScript. The latest version of the language is Kotlin M5.3
Kotlin project website is at kotlin.jetbrains.org.
All the codes here can be copied and run on Kotlin online editor.
Let's get started.
public abstract class ViewModelBase : MvxViewModel | |
{ | |
protected void ClearStackAndShowViewModel<TViewModel>() | |
where TViewModel : ViewModelBase | |
{ | |
var presentationBundle = new MvxBundle(new Dictionary<string, string> { { PresentationBundleFlagKeys.ClearStack, "" } }); | |
ShowViewModel<TViewModel>(presentationBundle: presentationBundle); | |
} | |
} |
package com.tomgibara.android.util; | |
import java.util.ArrayList; | |
import java.util.Arrays; | |
import java.util.EnumSet; | |
import android.os.AsyncTask; | |
import android.os.SystemClock; | |
import com.google.android.apps.analytics.GoogleAnalyticsTracker; |