Rounded and Squared Avatar for Android Applications

Overview

Avatars for Android Maven Central

This project provides a easy way to build avatar compositions for Android applications, as you can see in the screenshot.

Screenshot

Usage

Declare it into your pom.xml

<dependency>
    <groupId>net.sectorsieteg</groupId>
    <artifactId>avatars</artifactId>
    <version>1.0.0</version>
    <type>aar</type>
</dependency>

Or into your build.gradle

dependencies {
    compile 'net.sectorsieteg:avatars:1.0.0'
}

How to Use

Inside the layout, you only needs a ImageView in order to show the avatar.

    <ImageView
        android:id="@+id/avatar"
        android:layout_height="fill_parent"
        android:layout_width="fill_parent"/>

The AvatarDrawableFactory will abstract you about how the avatars are built. We will be able to create a rounded or a squared avatar from this entry point.

For the squared avatars depending of the number of images passed to the factory, a composition for one, two, three or four will be created. Returning the specific implementation for that case.

There are this types of compositions:

  • RoundedAvatarDrawable
  • BorderedRoundedAvatarDrawable
  • SquaredAvatarDrawable
  • DoubleSquaredAvatarDrawable
  • TripleSquaredAvatarDrawable
  • QuadrupleSquaredAvatarDrawable
BitmapFactory.Options options = new BitmapFactory.Options();
options.inMutable = false;
Bitmap avatar = BitmapFactory.decodeResource(getResources(), R.drawable.avatar, options);

AvatarDrawableFactory avatarFactory = new AvatarDrawableFactory(getResources());

Drawable avatarDrawable = avatarFactory.getSquaredAvatarDrawable(avatar, avatar);
ImageView avatarView = (ImageView)rootView.findViewById(R.id.avatar);
avatarView.setImageDrawable(avatarDrawable);

Contributors

License

Copyright 2014 Pedro Álvarez Fernández

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.
You might also like...
This light-weight library provides images with letter/text like the Gmail app. It extends the Drawable class thus can be used with existing/custom/network ImageView classes. Also included is a fluent interface for creating drawables and a customizable ColorGenerator. DMIV aims to provide a flexible and customizable instrument for automated images moving on display. It provides scroll, gyroscope or time based moving. But you can create your own evaluator.
DMIV aims to provide a flexible and customizable instrument for automated images moving on display. It provides scroll, gyroscope or time based moving. But you can create your own evaluator.

DexMovingImageView DMIV aims to provide a flexible and customizable instrument for automated images moving on display. It provides scroll, gyroscope o

Subclass of ImageView that 'morphs' into a circle shape and can rotates. Useful to be used as album cover in Music apps. :dvd::notes:
Subclass of ImageView that 'morphs' into a circle shape and can rotates. Useful to be used as album cover in Music apps. :dvd::notes:

Music Cover View A Subclass of ImageView that 'morphs' into a circle shape and can rotates. Useful to be used as album cover in Music apps. It's used

Add curve at bottom of image views and relative layouts.
Add curve at bottom of image views and relative layouts.

Crescento Android library that adds a curve at the below of image views and relative layouts. CrescentoImageView and CrescentoContainer are the image

A photoView to scale image and finish activity,高仿微信可拖拽返回PhotoView
A photoView to scale image and finish activity,高仿微信可拖拽返回PhotoView

DragPhotoView(English) 高仿微信可拖拽返回PhotoView 基于 PhotoView ##下载APK体验 特性 拖拽缩放图片,并且结束Activity 其他PhotoView所有特性如下: Out of the box zooming, using multi-touch a

Custom ImageView for android with polygon shape (Android)
Custom ImageView for android with polygon shape (Android)

PolygonImageView Create a custom ImageView with polygonal forms. Usage To use PolygonImageView, add the module into your project and start to build xm

Implementation of ImageView for Android that supports zooming, by various touch gestures.
Implementation of ImageView for Android that supports zooming, by various touch gestures.

PhotoView PhotoView aims to help produce an easily usable implementation of a zooming Android ImageView. [ Dependency Add this in your root build.grad

A circular ImageView for Android
A circular ImageView for Android

CircleImageView A fast circular ImageView perfect for profile images. This is based on RoundedImageView from Vince Mi which itself is based on techniq

Android filters based on OpenGL (idea from GPUImage for iOS)

GPUImage for Android Idea from: iOS GPUImage framework Goal is to have something as similar to GPUImage as possible. Vertex and fragment shaders are e

Owner
Pedro Álvarez Fernández
Pedro Álvarez Fernández
Crop and Rounded Corners added to an ImageView.

SuperImageView Extra features for your ImageView provided in a modularized way Documentation for v2 coming this week. CropImageView An ImageView that

César Díez Sánchez 657 Jan 5, 2023
Crop and Rounded Corners added to an ImageView.

SuperImageView Extra features for your ImageView provided in a modularized way Documentation for v2 coming this week. CropImageView An ImageView that

César Díez Sánchez 658 Dec 1, 2022
Big image viewer supporting pan and zoom, with very little memory usage and full featured image loading choices. Powered by Subsampling Scale Image View, Fresco, Glide, and Picasso. Even with gif and webp support! 🍻

BigImageViewer Big image viewer supporting pan and zoom, with very little memory usage and full featured image loading choices. Powered by Subsampling

Piasy 3.9k Dec 30, 2022
ImageView and FrameLayout with gestures control and position animation

GestureViews ImageView and FrameLayout with gestures control and position animation. Main goal of this library is to make images viewing process as sm

Alex Vasilkov 2.3k Dec 30, 2022
TouchPhotoViewer - A project configured with the AndroidX SDK 21 and and higher

TouchPhotoViewer A project configured with the AndroidX SDK 19 and and higher License Copyright (C) 2022 by HoangChung Licensed Licensed under the Apa

hoangchung 2 Jun 1, 2022
Android widget for cropping and rotating an image.

Cropper The Cropper is an image cropping tool. It provides a way to set an image in XML and programmatically, and displays a resizable crop window on

Edmodo 2.9k Nov 14, 2022
Android ImageView widget with zoom and pan capabilities

ImageViewTouch for Android ImageViewTouch is an android ImageView widget with zoom and pan capabilities. This is an implementation of the ImageView wi

Alessandro Crugnola 1.9k Jan 4, 2023
Create parallax and any other transformation effects on scrolling android ImageView

Android Parallax Image View Creates effect such as vertical parallax, horizontal parallax etc. on android ImageView when it's being vertically or hori

Aris 164 Dec 7, 2022
Customizable Android full screen image viewer for Fresco library supporting "pinch to zoom" and "swipe to dismiss" gestures. Made by Stfalcon

This project is no longer supported. If you're able to switch from Fresco to any other library that works with the Android's ImageView, please migrate

Stfalcon LLC 1.8k Dec 19, 2022
Slider-Gallery-Zoom: image slider for android supporting indicator and auto scroll with clicking on image

image slider supporting indicator and auto scroll with clicking on image to open full screen image slider swipe and pinch zoom gestures like gallery,just pass your images and the position of the current image.

Mahmoud Elian 3 May 28, 2022