Add curve at bottom of image views and relative layouts.

Overview

Crescento

Android library that adds a curve at the below of image views and relative layouts. CrescentoImageView and CrescentoContainer are the image view and relative layout respectively. You can change the radius of curve with attribute:curvature.

API Android Arsenal Android Weekly AndroidDev Digest

Sample Image 2

Overview

Crescento provides following advantages:

  • Curve Bottom: It adds a curve bottom as stated above.
  • Tint: It add tint on CrescentoImageView by using attribute:tintColor. It pick color automatically from the image if tintMode is set to automatic.
  • Alpha: Add transparency in tint by using attribute:tintAlpha. Varies from 0 to 255.
  • Gradient : Add gradient on the imageview.
  • Gravity : You can now add crescento to bottom of your layout. Arc will form on top.

Sample Apk

Use with KenBurnsView

Sample Image 1

<developer.shivam.library.CrescentoContainer android:id="@+id/crescentoContainer"
        android:layout_width="match_parent"
        android:layout_height="300dp"
        android:elevation="20dp"
        android:scaleType="centerCrop"
        attribute:curvature="50dp">

        <com.flaviofaria.kenburnsview.KenBurnsView
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:src="@drawable/wallpaper2" />
</developer.shivam.library.CrescentoContainer>

Donations

This project needs you! If you would like to support this project's further development, the creator of this project or the continuous maintenance of this project, feel free to donate. Your donation is highly appreciated (and I love food, coffee and beer). Thank you!

PayPal

  • Donate $5: Thank's for creating this project, here's a coffee (or some beer) for you!
  • Donate $10: Wow, I am stunned. Let me take you to the movies!
  • Donate $15: I really appreciate your work, let's grab some lunch!
  • Donate $25: That's some awesome stuff you did right there, dinner is on me!
  • Donate $50: I really really want to support this project, great job!
  • Donate $100: You are the man! This project saved me hours (if not days) of struggle and hard work, simply awesome!
  • Donate $2799: Go buddy, buy Macbook Pro for yourself! Of course, you can also choose what you want to donate, all donations are awesome!

Demo

Here is a very good example of how to use Crescento. Zsolt Szilvai has made a very good design and I've illustrated using crescento.

https://material.uplabs.com/posts/cinema-application-interface

Sample of Zsolt Szilvai's design

Gradle Integration

If you are using gradle then add these lines in build.gradle file at project level.

allprojects {
    repositories {
        ...
        maven { url "https://jitpack.io" }
    }
}
    

Add below lines in build.gradle at app level.

compile 'com.github.developer-shivam:Crescento:1.2.1'

Basic Usage

For a working implementation, see /app folder

ImageView

<developer.shivam.crescento.ImageView android:id="@+id/crescentoImageView"
    android:layout_width="match_parent"
    android:layout_height="300dp"
    android:elevation="20dp"
    android:scaleType="centerCrop"
    attribute:gravity="top"
    attribute:curvature="50dp"
    attribute:crescentoTintMode="manual"
    attribute:crescentoTintColor="#FFFFFF"
    attribute:tintAlpha="50" />

Container

<developer.shivam.crescento.Container android:id="@+id/crescentoContainer"
    android:layout_width="match_parent"
    android:layout_height="300dp"
    android:elevation="20dp"
    attribute:curvature="50dp">

    <!-- Your code here -->

</developer.shivam.library.CrescentoContainer>

Attributes

  • curvature: To change the size of curve.
  • curvatureDirection : To change the direction of curvature. Whether inward or outward.
  • tintColor: To add tint on image view.
  • tintMode: To add tint manually or automatically. If automatically it will pick color from image you have set.
  • tintAlpha: To set the amount of tint. 0 for 100% transparent and 255 for opaque.
  • gradientDirection : To set the direction of gradient. Supported direction are TOP_TO_BOTTOM, BOTTOM_TO_TOP, LEFT_TO_RIGHT and RIGHT_TO_LEFT.
  • gradientStartColor : gradient start color.
  • gradientEndColor : gradient end color.
  • gravity : To set gravity. TOP or BOTTOM.

Connect With Me

Shivam Satija (droidsergeant)

Connect me on Google+ Connect me on Facebook Connect me on LinkedIn

Question / Contact Me / Hire Me

Please feel free to ping me at [email protected]. Expected package would be 6 lpa.

License

MIT License

Copyright (c) 2016 Shivam Satija

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Comments
  • Attribute

    Attribute "tintMode" already defined with incompatible format.

    When using with Support library 25.4.0 Crescento's app:tintMode attribute clashes with tintMode attribute from the Support Libraries (ImageView, AppCompatImageView).

    Build error:

    Attribute "tintMode" already defined with incompatible format.
    Original attribute defined here.
    

    How to reproduce: create new project with Support Libraries 25.4.0 and Crescento library. Try to build and get the error.

    opened by aednlaxer 4
  • How to change the background color of the Crescento Container?

    How to change the background color of the Crescento Container?

    I do not require an imageview. I just need to have a curved layout with a different background color. But the background does not seem to change. It is always White.

    opened by anitaa1990 2
  • Change curvature programmatically

    Change curvature programmatically

    ((CrescentoImageView)findViewById(R.id.civ_header_bg)).setCurvature(1);

    Does not change view curvature since it doesn't refresh view. Already tried findViewById(R.id.civ_header_bg).invalidate(); but it's still not working. Any ideas?

    opened by btrincao-i9 1
  • Container inside card view with background resource throws error

    Container inside card view with background resource throws error

    ERROR: java.lang.IllegalArgumentException: path must be convex at android.graphics.Outline.setConvexPath(Outline.java:264) at developer.shivam.crescento.Container$1.getOutline(Container.java:100) at android.view.View.rebuildOutline(View.java:13079) at android.view.View.sizeChange(View.java:17769) at android.view.View.setFrame(View.java:17726) at android.view.View.layout(View.java:17634)

    XML: ` <android.support.v7.widget.CardView android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/top_corners_12dp">

                    <developer.shivam.crescento.Container
                        android:layout_width="match_parent"
                        android:layout_height="0dp"
                        android:layout_weight="1"
                        app:curvature="35dp"
                        app:gravity="top">
    
                        <ImageView 
                            android:layout_width="match_parent"
                            android:layout_height="match_parent"
                            android:scaleType="centerCrop"
                            android:background="@color/someColor" />
    
                    </developer.shivam.crescento.Container>
                </android.support.v7.widget.CardView>
    

    `

    opened by mreil617 1
  • XML Issues( Path.isConvex is not supported)

    XML Issues( Path.isConvex is not supported)

    If you use leftradius,rightradius and so on in your coding of this library , please change into only radius with same value.

    Because this thing issue an error in xml thats doesn't show any preview. Error is :- The graphics preview in the layout editor may not be accurate: - Path.isConvex is not supported

    Thank you.

    opened by ayush18verma 1
  • Failed to resolve: com.github.developer-shivam:Crescento:1.2.1

    Failed to resolve: com.github.developer-shivam:Crescento:1.2.1

    Failed to resolve: com.github.developer-shivam:Crescento:1.2.1 Show in Project Structure dialog Affected Modules: app

    Failed to resolve: com.github.developer-shivam:Crescento:1.2.1 Show in Project Structure dialog Affected Modules: app

    opened by cj3dreams 1
  • CrescentoImageView does not work with LayerDrawables

    CrescentoImageView does not work with LayerDrawables

    When attempting to use a <layer-list> drawable xml file, I get an issue similar to #9. Which I believe is caused by this not being assignable to LayerDrawable.

    Caused by: java.lang.ClassCastException: android.graphics.drawable.LayerDrawable cannot be cast to android.graphics.drawable.BitmapDrawable
        at com.example.CrescentoImageView.init(CrescentoImageView.java:174)
        at com.example.CrescentoImageView.<init>(CrescentoImageView.java:111)
        ... 46 more
    

    A work around was to use CrescentoContainer with an ImageView inside instead.

    opened by nishtahir 0
  • xml rendering issue

    xml rendering issue

    getting following issue as render problem in preview tab while viewing xml

    java.lang.IllegalArgumentException: Underflow in restoreToCount - more restores than saves at android.graphics.Canvas.restoreToCount(Canvas.java:604) at developer.shivam.crescento.CrescentoContainer.dispatchDraw(CrescentoContainer.java:115) at android.view.View.draw(View.java:19001) at android.view.ViewGroup.drawChild_Original(ViewGroup.java:4215) at android.view.ViewGroup_Delegate.drawChild(ViewGroup_Delegate.java:63) at android.view.ViewGroup.drawChild(ViewGroup.java:4215) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4001) at android.view.View.draw(View.java:19001) at android.view.ViewGroup.drawChild_Original(ViewGroup.java:4215) at android.view.ViewGroup_Delegate.drawChild(ViewGroup_Delegate.java:63) at android.view.ViewGroup.drawChild(ViewGroup.java:4215) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4001) at android.view.View.draw(View.java:19001) at android.view.ViewGroup.drawChild_Original(ViewGroup.java:4215) at android.view.ViewGroup_Delegate.drawChild(ViewGroup_Delegate.java:63) at android.view.ViewGroup.drawChild(ViewGroup.java:4215) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4001) at android.view.View.draw(View.java:19001) at android.view.ViewGroup.drawChild_Original(ViewGroup.java:4215) at android.view.ViewGroup_Delegate.drawChild(ViewGroup_Delegate.java:63) at android.view.ViewGroup.drawChild(ViewGroup.java:4215) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4001) at android.view.View.draw(View.java:19136) at com.android.layoutlib.bridge.impl.RenderSessionImpl.renderAndBuildResult(RenderSessionImpl.java:403) at com.android.layoutlib.bridge.impl.RenderSessionImpl.renderAndBuildResult(RenderSessionImpl.java:550) at com.android.layoutlib.bridge.impl.RenderSessionImpl.render(RenderSessionImpl.java:424) at com.android.layoutlib.bridge.BridgeRenderSession.render(BridgeRenderSession.java:108) at com.android.ide.common.rendering.api.RenderSession.render(RenderSession.java:154) at com.android.ide.common.rendering.api.RenderSession.render(RenderSession.java:136) at com.android.tools.idea.rendering.RenderTask.lambda$renderInner$5(RenderTask.java:759) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745)

    opened by NayanaRBhoj 0
  • All com.android.support libraries must use the exact same version specification

    All com.android.support libraries must use the exact same version specification

    I am getting this error on my gradle file. It builds and works fine but it's still annoying to have.

    It looks like this: https://i.imgur.com/VRF2RNt.png

    I think the support libraries should be updated to 27.1.1 from 27.0.1.

    opened by yigitserin 1
  • CrescentoContainer not working on android 4.3

    CrescentoContainer not working on android 4.3

    I test it on android 4.3, but when running app, crescento don't apply. I added attribute Namespace to root layout but doesn't work. please help me. thanks.

    opened by Sirvanalie 0
Owner
Shivam Satija
On a journey to be a better software engineer! #iwbab@27
Shivam Satija
Awesome Image Picker library will pick images/gifs with beautiful interface. Supports image or gif, Single and Multiple Image selection.

Awesome Image Picker Awesome Image Picker library will pick images/gifs with beautiful interface. Supports image or gif, Single and Multiple Image sel

Prabhakar Thota 162 Sep 13, 2022
RoundedImageView-Library 0.9 0.0 Java To set single or multiple corners on Image Views.

RoundedImageView-Library Rounded ImageView Android Library, to set single or multiple corners on imageview. Screenshot Usage Step 1. Add the JitPack r

Dushyant Mainwal 15 Sep 2, 2020
This is an Image slider with swipes, Here we used Volley to Image load URL's from JSON! Here we make it very easy way to load images from Internet and We customized the description font style(OpenSans).

ImageSliderWithSwipes This is an Image slider with swipes, Here we used Volley to load URL's from JSON! Here we make it very easy way to load images f

Prabhakar Thota 44 May 31, 2021
LSPosed module to add Google Pixel features on Google Photos for any device.

Pixelify-Google-Photos LSPosed module to add Google Pixel features on Google Photos for any device. LSPosed module repo Development repo Steps to use:

null 502 Jan 9, 2023
Library to save image locally and shows options to open and share !

Image Save and Share Library to save image locally and shows options to open and share ! Download Demo APK from HERE Kindly use the following links to

Prabhakar Thota 27 Apr 18, 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
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
Dali is an image blur library for Android. It contains several modules for static blurring, live blurring and animations.

Dali Dali is an image blur library for Android. It is easy to use, fast and extensible. Dali contains several modules for either static blurring, live

Patrick Favre-Bulle 1k Dec 1, 2022
Auto Scrolling Image Pager with Pager Indicator and Text

AutoImageFlipper Auto Scrolling Image Pager with Pager Indicator and Text Note: It works only on Apps which are using AndroidX dependencies, if you're

Shahbaz Hussain 105 Nov 10, 2022
An Android project containing image recognition and object detection models.

An Android project containing image recognition and object detection models. Users can input images into the deep learning model by taking photos, opening photo albums, and real-time previews on the Android side. After the calculation on the Android side is completed, the model will output the prediction result and show it to the user.

null 7 Nov 27, 2022
An Android transformation library providing a variety of image transformations for Coil, Glide, Picasso, and Fresco.

An Android transformation library providing a variety of image transformations for Coil, Glide, Picasso, and Fresco.

Daichi Furiya 257 Jan 2, 2023
Pixel Boom is a Java-based Android software, featuring image super-resolution and colorization

Pixel Boom is a Java-based Android software, featuring image super-resolution and colorization.

Zaitian 1 Jul 3, 2022
some android image filters

android-image-filter some android image filters in some filter, I use NDK to implement to make it more efficient Setup Install Android NDK and properl

RagnarokStack 643 Dec 27, 2022
An android image compression library.

Compressor Compressor is a lightweight and powerful android image compression library. Compressor will allow you to compress large photos into smaller

Zetra 6.7k Dec 31, 2022
A simple image cropping library for Android.

SimpleCropView The SimpleCropView is an image cropping library for Android. It simplifies your code for cropping image and provides an easily customiz

Issei Aoki 2.5k Dec 28, 2022
A small customizable library useful to handle an gallery image pick action built-in your app. :sunrise_over_mountains::stars:

Louvre A small customizable image picker. Useful to handle an gallery image pick action built-in your app. *Images from Google Image Search Installati

André Mion 640 Nov 19, 2022
An image resizing library for Android

Resizer Inspired by zetbaitsu's Compressor, Resizer is a lightweight and easy-to-use Android library for image scaling. It allows you to resize an ima

Kakit Ho 426 Dec 22, 2022
✔️ Hide a secret message in an image

Image Steganography Steganography is the process of hiding a secret message within a larger one in such a way that someone cannot know the presence or

Ayush Agarwal 120 Dec 18, 2022
Simple android image popup Library

Android Image Popup Show image as a popup on a click event or any event. Simply set the image as drawable and thats it!!!. And also you can set width,

Chathura Lakmal 64 Nov 15, 2022