A simple Android library that applies shadows of any color to views and allows easy manipulation of edges.

Related tags

App ComplexView
Overview

ComplexView

Android Arsenal

A simple Android library that applies shadows of any color to views and allows easy manipulation of edges. ComplexView now supports shadow positioning starting from v1.1







Alt text

Gradle setup

repositories{
    maven { url 'https://jitpack.io' }
}

dependencies{

implementation 'com.github.BluRe-CN:ComplexView:v1.1'
    
}

Maven setup

<repositories>
  <repository>
    <id>jitpack.io</id>
     <url>https://jitpack.io</url>
  </repository>
</repositories>
    
<dependency>
  <groupId>com.github.BluRe-CN</groupId>
   <artifactId>ComplexView</artifactId>
   <version>Tag</version>
</dependency>

Usage

Alt text

Alt text

Xml

Code to achieve the above effect

<com.blure.complexview.ComplexView
        android:layout_width="100dp"
        android:layout_height="100dp"
        app:radius="50dp"
        app:shadow="true"
        app:shadowAlpha="100"
        app:shadowColor="#0061FF"
        app:shadowSpread="2">

        <com.blure.complexview.ComplexView
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            app:color="#fdfcfc"
            app:radius="50dp">

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerInParent="true"
                android:layout_margin="5dp"
                android:text="Shadow" />
        </com.blure.complexview.ComplexView>
    </com.blure.complexview.ComplexView>

Java

Code to achieve the above effect

        //Initialize parent as a shadow
        ComplexView shadow = new ComplexView(this);
        ComplexView.LayoutParams param = new ComplexView.LayoutParams(convertDpToPixel(100), convertDpToPixel(100));
        float[] radii = {50, 50, 50, 50, 50, 50, 50, 50};
        shadow.setShadow(new Shadow(2, 100, "#0061FF", GradientDrawable.RECTANGLE, radii));
        shadow.setLayoutParams(param);

        //Create holder for TextView
        ComplexView tvHolder = new ComplexView(this);
        ComplexView.LayoutParams tvHolderParam = new ComplexView.LayoutParams(ComplexView.LayoutParams.MATCH_PARENT,       ComplexView.LayoutParams.MATCH_PARENT);
        tvHolder.setRadius(50);
        tvHolderParam.addRule(CENTER_IN_PARENT);
        tvHolder.setColor(Color.parseColor("#fdfcfc"));
        tvHolder.setLayoutParams(tvHolderParam);

        //Create TextView object
        TextView tv = new TextView(this);
        ComplexView.LayoutParams tvParam = new ComplexView.LayoutParams(ComplexView.LayoutParams.WRAP_CONTENT, ComplexView.LayoutParams.WRAP_CONTENT);
        tvParam.addRule(CENTER_IN_PARENT);
        tvParam.setMargins(5, 5, 5, 5);
        tv.setLayoutParams(tvParam);
        tv.setText("Shadow");
        
        //Couple up
        tvHolder.addView(tv);
        shadow.addView(tvHolder);
        YourMainView.addView(shadow);
You might also like...
A beautiful app showing the use of a single recyclerview to display multiple views with motion layout and clean architecture
A beautiful app showing the use of a single recyclerview to display multiple views with motion layout and clean architecture

This app shows how to use a single recyclerview to build a beautiful multiple view layout (See image below) using clean architectural pattern

Extensible Android mobile voice framework: wakeword, ASR, NLU, and TTS. Easily add voice to any Android app!
Extensible Android mobile voice framework: wakeword, ASR, NLU, and TTS. Easily add voice to any Android app!

Spokestack is an all-in-one solution for mobile voice interfaces on Android. It provides every piece of the speech processing puzzle, including voice

Browse your memories without any interruptions with this photo and video gallery
Browse your memories without any interruptions with this photo and video gallery

Simple Gallery Simple Gallery Pro is a highly customizable lightweight gallery loved by millions of people for its great user experience. Organize and

ComicsShow app: Display comics and search for any favourites one

ComicsShow app: Display comics and search for any favourites one. Technologies used: Koin: For injecting class and providing modules on runtime :). Vi

HyperUPnP is Android Application that lets you to Stream Media from PC, NAS or any other device running UPnP/DLNA compliant media server to your Android Device.

Hyper UPnP Android UPnP/DLNA client Stream Media from PC, NAS or any other device running UPnP/DLNA compliant media server to your Android Device. Int

Android Phishing Application.This Project is for Educational purposes only.The Developer of this application is not responsible of any bad usage
Android Phishing Application.This Project is for Educational purposes only.The Developer of this application is not responsible of any bad usage

Android Phishing Application.This Project is for Educational purposes only.The Developer of this application is not responsible of any bad usage

A minimalistic Face Recognition module which can be easily incorporated in any Android project.
A minimalistic Face Recognition module which can be easily incorporated in any Android project.

Real Time Face Recognition with TfLite A minimalistic Face Recognition module which can be easily incorporated in any Android project. Key Features Fa

Android app for monitoring web services. Notifies you of any HTTP or Onion destination not being available.
Android app for monitoring web services. Notifies you of any HTTP or Onion destination not being available.

Webmon Monitor web services and get notified, if a service becomes unavailable. EARLY BIRD DOWNLOAD App Features Simple UI. No login required. Get not

☁️🌤🌧☀ Weather Android application that gives you the weather information of your saved location or any region you are looking for☁️🌤🌧☀
☁️🌤🌧☀ Weather Android application that gives you the weather information of your saved location or any region you are looking for☁️🌤🌧☀

☁️🌤🌧☀ Weather Android application that gives you the weather information of your saved location or any region you are looking for☁️🌤🌧☀

Comments
  • Change shadowColor programatically

    Change shadowColor programatically

    Hey, thanks for a nice library.

    It would be great to change value type of app:shadowColor to color resource instead of string and also to add a possibility to change this color programmatically.

    opened by micer 0
Releases(v1.1)
Owner
BluRe CN
An Android/Java software developer
BluRe CN
An android app which allows users to display the data of any excel sheet in rows and columns

ExcelReader App description An android app which allows users to display the data of any excel sheet in rows and columns. Features Display data of an

Srihitha Tadiparthi 4 Oct 25, 2022
Application that allows to search some products and display them in a list, also allows to add some product to the shopping cart and remove it

Application that allows to search some products and display them in a list, also allows to add some product to the shopping cart and remove it

Victor 3 Aug 18, 2022
Utility Android app for generating color palettes of images using the Palette library. Written in Kotlin.

Palette Helper is a simple utility app made to generate color palettes of images using Google's fantastic Palette library. It's mostly a for-fun pet p

Zac Sweers 154 Nov 18, 2022
Utility Android app for generating color palettes of images using the Palette library. Written in Kotlin.

Palette Helper is a simple utility app made to generate color palettes of images using Google's fantastic Palette library. It's mostly a for-fun pet p

Zac Sweers 154 Nov 18, 2022
Theme for VSCode and JetBrains IDEs, based on morhetz/gruvbox but with a plainer color palette for syntax highlighting.

gruvbox-plain Theme for VSCode and JetBrains IDEs, based on morhetz/gruvbox but with a plainer color palette for syntax highlighting. Syntax Colors gr

null 2 Dec 28, 2022
Easy-Note - Easy Note Application will help user to add and update their important notes

Easy-Note ??️ Easy Note App helps you to create your notes. You can ?? edit and

Ade Amit 0 Jan 30, 2022
A small API to add Quran with Tajweed Color in Android App

QuranApi A simple Api to implement Quran in Android. Add To Project Step 1. Add the JitPack repository to your build file Add it in your root build.gr

DevilCat 11 Aug 5, 2022
QuatroGrade is a beautiful multi color (4 corners) gradient.

| | Setup Guide | Report new issue QuatroGrade QuatroGrade is a beautiful multi color gradient. Basically, it is a 4 vertex gradient. Features: Multi

Basil Miller 33 Oct 9, 2022
An app to detect color palettes in the real world - powered by VisionCamera

Colorwaver An app to detect colorwaves (swatches/palettes) in the real world - powered by VisionCamera and Reanimated. I wrote this app in less than a

Marc Rousavy 476 Dec 25, 2022
A simple and easy to use stopwatch and timer library for android

TimeIt Now with Timer support! A simple and easy to use stopwatch and timer library for android Introduction A stopwatch can be a very important widge

Yashovardhan Dhanania 35 Dec 10, 2022