Материалы к докладу на AppLive 2020.
- Что такое единый стейт? Если экран сложный, то как описывать сложные стейты. Если через seald class, то по какому принципу описывать seald class со стейтом?
- Как работать с single liveData (map/distinct?)
- Как работать с command liveData? Нужно разделить общие команды и приватные для каждого экрана.
- Как подружить liveData и state-delegate? Какую сделать структуры обертки для загружаемых данных(Loading, Content, Error).
- Как обрабатывать пересоздание диалогов (как подсунуть новую лямбду) Нужно посмотреть сюда.
Материалы к докладу на митап Redmadrobot 30 апреля.
Habr | YouTube | Презентация
The Material Components Library introduced with the 1.2.0-alpha03
the new ShapeableImageView
.
In your layout you can use:
<com.google.android.material.imageview.ShapeableImageView
android:id="@+id/image_view"
app:srcCompat="@drawable/..." />
Then in your code apply the ShapeAppearanceModel
to define your custom corners:
object Example { | |
fun alterTableUsage(database: SupportSQLiteDatabase) { | |
DbMigrationsHelper.alterTable( | |
db = database, | |
tableName = "Reservations", | |
columns = mapOf( | |
"id INTEGER".toExisting(), // Retains without changes | |
"title TEXT".toExisting("name"), // Renames column "name" to "title" | |
"description TEXT".toNothing(), // Adds a new column |
package com.example.ui | |
import android.app.Activity | |
import android.content.Intent | |
import android.os.Bundle | |
import com.example.util.toKeyValueString | |
import timber.log.Timber | |
class AppActivity : Activity() { |
android { | |
applicationVariants.all { variant -> | |
variant.outputs.all { | |
def fileName = "app" | |
switch (variant.buildType.name) { | |
case "debug": | |
fileName = "${appNameDebug}-${variant.versionCode}" | |
break | |
case "release": | |
fileName = "${appNameRelease}-${variant.versionCode}" |
A long time ago, it was possible to inline images from all kinds of external sources. Since the switch from HTTP to HTTPS, this is no longer possible; only HTTPS sources are allowed. This leads to ugly blurbs like
instead of a nicely formatted page with images. Sometimes, the links don't even work anymore, even with HTTPS images, which will show like this: ... Luckily, we have the Wayback Machine which is able to rescue some of the lost images. Since a picture often says more than a thousand words, it's important to bring back the post into its original state; important enough to justify the occasional bump of an old post (see below).
import android.content.Context | |
import android.support.v4.view.ViewCompat | |
import android.support.v4.widget.ViewDragHelper | |
import android.util.AttributeSet | |
import android.view.MotionEvent | |
import android.view.View | |
import android.widget.FrameLayout | |
class SwipeView @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0) : FrameLayout(context, attrs, defStyleAttr) { |
#!/bin/bash | |
# Clean up on exit | |
function finish { | |
rm -f expected found | |
} | |
trap finish EXIT | |
# How to parse JSON | |
JQ="jq --sort-keys" |