画像読み込みライブラリ「COIL」

Glide や Picasso のような画像読み込みライブラリです。

COroutine
Image
Loader

の略だそうです。

以下の特徴を持っており、ナウい感じです。

- 拡張関数、ラムダなどKotlinの持つ機能を活用。
- コルーチンを利用。
- ディスクキャッシュとストリームバッファリング機能。
- androidx.lifecycle に対応。
- 軽量。
- R8対応。ルール不要。

👉 Introducing Coil: Kotlin-first image loading on Android 

記述例です。


// To load an image into an ImageView, use the load extension function.
imageView.load("https://www.example.com/image.jpg")

// Coil supports urls, uris, resources, drawables, bitmaps, files, and more.
imageView.load(R.drawable.image)

imageView.load(File("/path/to/image.jpg"))

imageView.load(Uri.parse("content://com.android.externalstorage/image.jpg"))

// Requests can be configured with an optional trailing lambda.
imageView.load("https://www.example.com/image.jpg") {
    crossfade(true)
    placeholder(R.drawable.image)
    transformations(CircleCropTransformation())
}

// Custom targets can be created using lambda syntax (onStart and onError are optional).
Coil.load(context, "https://www.example.com/image.jpg") {
    target { drawable ->
        // Handle the successful result.
    }
}

// To get an image imperatively, use the get suspend function.
val drawable = Coil.get("https://www.example.com/image.jpg")

👉 GitHub - coil-kt/coil: Image loading for Android backed by Kotlin Coroutines. 

パフォーマンスを Glide や Picasso と比較した記事がありますが、まあまあのようです。

Coil is a new library, so its performance may increase in the next versions. We are comparing it with mature libraries, so let’s see how it evolves.

Coil は新しいライブラリであるため、次のバージョンでパフォーマンスが向上する可能性があります。成熟したライブラリと比較しているので、どのように進化するか見ておきましょう。

👉 Coil vs Picasso vs Glide: Get Ready… Go! - ProAndroidDev 

ちなみに、必要環境は以下。

- AndroidX
- Min SDK 14+
- Compile SDK: 28+
- Java 8+

今後に期待できますかね。


Studio does not have write access to /private/var/folders/Android Studio.app/Contents. Please run it by a privileged user to update. で Android Studio が更新できない。

これ。

Studio does not have write access to /private/var/folders/Android Studio.app/Contents. Please run it by a privileged user to update.

と表示されて、新バージョンに更新できません。

Toolbox App のトッラカーにて。

👉 Android 3.5.0 not available many hours after release : TBX-3894 

Toolbox App 公式ブログ。


👉 JetBrains Toolbox 2019.2 | JetBrains Blog 

こういうところで、Google と JetBrains 間で微妙にズレちゃうんでしょう。

今現在私のMac版は最新で。

Toolbox App 側が更新されるのをじっと待つのが吉でしょうな。

追記:2019-08-21 20:07

Toolbox App のバージョンはそのままだけども、Android Studio 3.4 の「UPDATE」ボタンが有効になって3.5へのアップデートが可能となりました!

そして、何度かのダイアログ「OK」→「Restart」を経てやっとアップデート完了できましたとさ。

👉 さらば proguard、ようこそ R8。 

(👉つづく...)


「Google Go」からの読み上げ機能が楽ちん!

👉 軽量版Googleアプリ「Google Go」、日本を含む世界で公開 音声読み上げ機能も - ITmedia NEWS 

カメラ起動からでは見えない「読み上げ機能」が分かりやすく使いやすく利用できるようになります。

ここでは、パソコンのディスプレイに写ったブラウザ上の英文を読み上げしてみました。



英文のまま読み上げたり、日本語に翻訳して読み上げたり、単語を選択して辞書を開いたりできます。

👉 Google Go: A lighter, faster way to search - Google Play のアプリ 


Dagger2 Dependency Graph を視覚化する「Daggraph」

クローズドな一般国内環境にて、

他人の書いたコードというのは、

非常に読みづらいものです。

Dagger のようなバイトコードを生成するコンパイルタイムなフレームワークであればさらにその特性は増してしまいます。

図で視覚化して概要を捉えましょう。



👉 dvdciri/daggraph: Dagger dependency graph generator for Android Developers 

シンプルなコマンドラインツールなので入れてみて損はないでしょう。


テキストエディタ nvALT【Mac】

こんな記事を見ました。

nvALT syncs with Simplenote. This is handy because nvALT is macOS only. So you can use the Simplenote iOS app to keep your extra brain nearby on the go.

Simplenote also has a macOS app. You may think: Why not use the Simplenote desktop application? Because — it’s not quite as fast. We’re talking milliseconds, but it’s enough that you feel the difference. It’s the difference between the $1000 Japanese garden shears and the $150 garden shears. They both cut just fine, but if you work in the garden all day, you will (probably?) feel the difference.

nvALT は Simplenote と同期できます。nvALT は mac だけのアプリなのでこれは便利です。よって、外出時に、Simplenote の iOS アプリを利用することができます。

Simplenote には mac OS アプリもあります。どうして、Simplenote のデスクトップアプリを使わないのか、とあなたは思うかもしれません。速さが違います。ミリ秒レベルの話ですが違いを認識するには十分な速さです。

👉 Fast Software, the Best Software — by Craig Mod 

テキストエディタ以外のアプリについても言及していますが、述べられてることは共感できることが多いです。

nvALT*
Simplenote
Ulysses
Sublime Text

Lightroom
Photoshop
Affinity Photo*

Sketch*
Figma*
Illustlator

Apple Maps*
Google Map

Keynote

「nvALT」使ってみましょう。

使ってみる

文章サイズのテキスト。

私は、編集するのに Simplenote の Mac用デスクトップクライアントを使っていました。

インストールしてみます。

👉 nvALT - BrettTerpstra.com 

サクサクに動きます。

しかも、Simplenote とクラウド連携できる。

Simplenote ユーザでない人は、Dropbox で連携も可能な様子。

良い、これ。

当分使ってみることにします。