Skip to content

Instantly share code, notes, and snippets.

@koral--
koral-- / strings.xml
Created January 14, 2018 03:00
Non-translatable string in Android string resource file
<string name="author" translatable="false">Droids On Roids</string>
@koral--
koral-- / strings.xml
Created January 14, 2018 17:24
Referenced string resources
<string name="tab_foo">Foo</string>
<string name="tab_baz">Baz</string>
<string-array name="tab_labels">
<item>@string/tab_foo</item>
<item>@string/tab_baz</item>
</string-array>
@koral--
koral-- / strings.xml
Created January 14, 2018 18:13
XML entity in strings.xml
<!DOCTYPE resources [
<!ENTITY foo "Foo">
]>
<resources>
<string name="app_name">&foo;</string>
<string name="busy_warning">Sorry, &foo; is working hard, please try again in a moment.</string>
<string name="trademark">&foo; is a registerd trademark, all rights reserved.</string>
</resources>
@koral--
koral-- / strings.xml
Created January 15, 2018 00:42
tools:locale attribute usage
<resources xmlns:tools="http://schemas.android.com/tools" tools:locale="pl">
@koral--
koral-- / strings.xml
Last active January 15, 2018 03:22
Polish plural in default translation with other quantity
<resources xmlns:tools="http://schemas.android.com/tools" tools:locale="pl">
<plurals name="numberOfSongsAvailable">
<item quantity="one">Znaleziono %d piosenkę.</item>
<item quantity="few">Znaleziono %d piosenki.</item>
<item quantity="many">Znaleziono %d piosenek.</item>
<item quantity="other">Liczba znalezionych piosenek: %d.</item>
</plurals>
</resources>
<resources xmlns:tools="http://schemas.android.com/tools" tools:locale="pl">
<plurals name="numberOfSongsAvailable">
<item quantity="one">Znaleziono %d piosenkę.</item>
<item quantity="few">Znaleziono %d piosenki.</item>
<item quantity="other">Znaleziono %d piosenek.</item>
</plurals>
</resources>
@koral--
koral-- / Example.kt
Last active February 5, 2018 05:12
Android string formatting
val text = resources.getString(R.string.welcome_message, 4) //"You have 4 new messages."
@koral--
koral-- / step.yml
Last active May 7, 2018 01:32
Flutter dependencies
deps:
brew:
- name: git
- name: curl
- name: unzip
apt_get:
- name: git
- name: curl
- name: unzip
- name: libglu1-mesa
@koral--
koral-- / step.yml
Created May 5, 2018 01:21
Bitrise Flutter step inputs
inputs:
- version: 0.3.1-beta
opts:
title: "Flutter version"
summary: Flutter version including channel. Without `v` prefix. E.g. `0.2.8-alpha` or `0.3.0-dev`.
is_expand: true
is_required: true
- working_dir: $BITRISE_SOURCE_DIR
opts:
@koral--
koral-- / config.go
Last active May 6, 2018 22:20
Bitrise Flutter step config model
// Config ...
type Config struct {
Version string `env:"version,required"`
WorkingDir string `env:"working_dir,dir"`
Commands []string `env:"commands,required"`
}