(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.
(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.
#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 class MyApp extends Application { | |
@Override | |
public void onCreate() { | |
TypefaceUtil.overrideFont(getApplicationContext(), "SERIF", "fonts/Roboto-Regular.ttf"); // font from assets: "assets/fonts/Roboto-Regular.ttf | |
} | |
} |
suspend fun doSomething(webView: WebView): Int { | |
val v1 = firstAction() | |
val v2 = secondAction(webView) | |
val v3 = thirdAction() | |
return v1 + v2 + v3 // .i.e. 42 | |
} | |
suspend fun firstAction(): Int = | |
// Do some stuff on the network for example ... |
// Inspired by https://gist.github.com/tanmatra/3c2cec5d5d4345bea7a5f7c105af7238 | |
import Effects.Companion.withEffects | |
import io.smallibs.utils.Await | |
import kotlinx.coroutines.GlobalScope | |
import kotlinx.coroutines.Job | |
import kotlinx.coroutines.launch | |
import kotlin.coroutines.Continuation | |
import kotlin.coroutines.resume | |
import kotlin.coroutines.suspendCoroutine |
Introduction
AppCompat is an Android support library to provide backwards-compatible functionality for Material design patterns. It currently comes bundled with a set of styles in the Theme.AppCompat
and Widget.AppCompat
namespaces. However, there is a critical component missing which I would have thought essential to provide the a default from which we could inherit our styles: Widget.AppCompat.Button
. Sure, there's Widget.AppCompat.Light.ActionButton
, but that doesn't actually inherit from Widget.ActionButton
, which does not inherit from Widget.Button
, so we might get some unexpected behavior using that as our base button style, mainly because Widget.ActionButton
strictly belongs in the ActionBar
.
So, if we want to have a decently normal default button style related to AppCompat, we need to make it ourselves. Let's start by digging into the Android SDK to see how it's doing default styles.
Digging In
We are a dedicated team of movie and TV enthusiasts building a unique content platform centered around movies and TV-series for web, mobile and third-party systems.
Currently, we're growing our design and development team from the ground up. Given the competitive nature of our industry and the app development space, we're keeping our efforts to ourselves for the time being. But we'd love to give the right person the grand tour, and the option to join an exciting new startup in its early stages.
We are very open to remote freelancers, but require you to be open to visit our main office in Norway on a regular basis. Our remote workers start with a 2-4 week period in Norway before transitioning back to their remote locations, and come back to Norway every ~3 months for a 1-2 week period. All trips and stays in Norway are of co