さまよえる、Android

Androidのプログラミングで便利なことや残しておきたいことを残しておく。もしオススメのライブラリがあったら教えてくださいね。

AndoridのUIライブラリ、CircleImageViewを使ってみた。

ユーザーのアイコンを丸くマスクしたいときに便利かも

github.com

https://camo.githubusercontent.com/e17a2a83e3e205a822d27172cb3736d4f441344d/68747470733a2f2f7261772e6769746875622e636f6d2f68646f64656e686f662f436972636c65496d616765566965772f6d61737465722f73637265656e73686f742e706e67

いつもの

    compile 'de.hdodenhof:circleimageview:2.0.0'

こんな感じ

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:background="#111111"
    android:layout_height="match_parent"
    tools:context=".MainActivity">

    <de.hdodenhof.circleimageview.CircleImageView
        android:layout_width="140dp"
        android:layout_height="140dp"
        android:layout_centerInParent="true"
        android:src="@mipmap/ic_launcher"
        app:civ_border_width="2dp"
        app:civ_border_color="#fff" />

</RelativeLayout>