Giter Club home page Giter Club logo

double-avatar-view's Introduction

Double Avatar View

Instagram-like (from broadcasts) double avatar view with cropping

Demo APK: https://petersamokhin.com/files/projects/doubleavatar/dav.apk

Install

  1. Add jitpack repo to your project-level build.gradle:
allprojects {
    repositories {
        // other repos
	    maven { url 'https://jitpack.io' }
    }
}
  1. Add library to your dependencies:
dependencies {
    implementation 'com.github.petersamokhin:double-avatar-view:$ACTUAL_VERSION'
}

See last version: https://github.com/petersamokhin/double-avatar-view/releases

Usage

Configure view in your xml layout file:

<com.petersamokhin.android.doubleavatarview.DoubleAvatarView
        android:id="@+id/dav"
        android:layout_width="200dp"
        android:layout_height="200dp"
        app:cut_size_coeff="1.115"
        app:second_size_coeff="2"
        app:horizontal_offset="0.15"
        app:vertical_offset="0.15" />

Or configure view from Java/Kotlin:

val config = DoubleAvatarView.Config(
            "https://back.avatar/",
            "https://front.avatar/",
            0.15f,                     // horizontal offset in percents of back image's width
            0.15f,                     // vertical offset in percents of back image's height
            2f,                        // front image radius multiplier
            1.115f                     // front image's cropped background radius multiplier
)
dav.updateConfig(config)

double-avatar-view's People

Contributors

petersamokhin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.