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
Android library written in kotlin that add a noise effect to image.

NoiseView With NoiseView you can easily add a noise effect to your image. See demo on YouTube Setup The library is pushed to jCenter() as an AAR, so y

Przemek 46 Sep 8, 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
Image Picker with Customizable UI for Android, Pick an image from Gallery

Image Picker A Image Picker Library for Android (Supports Android 12) with fully

null 2 May 29, 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
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

androidwing 1.6k Dec 5, 2022
Android ImageView replacement which allows image loading from URLs or contact address book, with caching

Smart Image View for Android SmartImageView is a drop-in replacement for Android’s standard ImageView which additionally allows images to be loaded fr

James Smith 1.3k Dec 24, 2022
Replacement for deprecated official Android crop image function

The MIT License (MIT) Copyright (c) 2012 Jan Muller Permission is hereby granted, free of charge, to any person obtaining a copy of this software and

Jan Muller 561 Nov 25, 2022
Custom ImageView for moving image around the screen (Android)

MovingImageView Create a custom ImageView for moving image around the screen. Usage To use MovingImageView, add the module into your project and start

Albert Grobas 819 Nov 18, 2022
Flickable ImageView for Android. It's like a view of twitter's detail image.

FlickableView Flickable ImageView for Android. It's like a view of twitter's detail image. It's possible that other views animate with FlickableView.

goka 153 Nov 14, 2022
Android library to generate image avatar from the first letter of a username. Letter avatar like Gmail Android best practice

AvatarImageGenerator Generate first letter avatar Image like gmail's contact avatar. It generates an drawable that can be be set to an ImageView. Inst

Korir Amos 61 Sep 25, 2022
Custom ImageView to generate captcha image.

CaptchaImageView Custom ImageView to generate captcha image. Add CaptchaImageView to your layout <test.jinesh.captchaimageviewlib.CaptchaImageView

Jinesh Francis 610 Oct 18, 2022
This is a library for make auto slide image in android

Auto Image Slider Screenshot Image Slider Default Image Slider With Custom Adapter Usage Add ImageSlider to your layout

Afdhal_FA 17 Dec 1, 2022
Android Library for cropping an image at ease.

Cropper - Android Image Cropper Android Image Cropper Powerful (Zoom, Rotation, Multi-Source); Customizable (Shape, Limits, Style); Optimized (Async,

Akshat Tiwari 24 Aug 24, 2022
A library for Android provides blurred drop shadows to ImageView similar to iOS image backdrop shadows

A library for Android provides blurred drop shadows to ImageView similar to iOS image backdrop shadows.Provides fast canvas draw as no renderscript needed .The similar shadow blurred effects can also be seen in iOS Music App.

Vivek Verma 163 Dec 31, 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 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