A android library for generating DID identicons.
implementation 'io.arcblock.did:did-motif:${version}'
render DID Motif:
- 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"
/>
- 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.
render Blockies IdentIcon
- add view in xml
<io.arcblock.did_motif.blockies.BlockiesIdenticon
android:id="@+id/identicon"
android:layout_width="100dp"
android:layout_height="100dp"
/>
- 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.
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.