Skip to content

ArcBlock/did-motif-android

Repository files navigation

did-motif-android

A android library for generating DID identicons.

Install

Maven Central

implementation 'io.arcblock.did:did-motif:${version}'

Usage

render DID Motif:

  1. add view in xml
    <com.arcblock.wallet.appcommonres.view.didmotif.DIDMotif
        android:id="@+id/motif_circle"
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:layout_marginTop="10dp"
        />
  1. set motif address
binding.motifCircle.setAddress(address, DIDMotif.Shape.Circle, true)

there are 4 shape of DIDMotif: Circle, Square, Hexagon and Rectangle. and the last parameter indicates whether to render the animation. image

render Blockies IdentIcon

  1. add view in xml
    <io.arcblock.did_motif.blockies.BlockiesIdenticon
        android:id="@+id/identicon"
        android:layout_width="100dp"
        android:layout_height="100dp"
        />
  1. set data in kotlin
binding.identicon.setAddress(ethAddress,BlockiesIdenticon.SHAPE_SQUARE, BlockiesData.DEFAULT_SIZE, 20f)

the Blockies Identicon only has 2 shape: Circle and Square.

image

LICENSE

                Copyright [2022] [ArcBlock.io]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

<http://www.apache.org/licenses/LICENSE-2.0>

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

About

A android library for generating DID identicons.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published