项目作者: developer-shivam

项目描述 :
Add curve at bottom of image views and relative layouts.
高级语言: Java
项目地址: git://github.com/developer-shivam/Crescento.git
创建时间: 2016-11-17T12:08:14Z
项目社区:https://github.com/developer-shivam/Crescento

开源协议:MIT License

下载


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

  1. <developer.shivam.library.CrescentoContainer android:id="@+id/crescentoContainer"
  2. android:layout_width="match_parent"
  3. android:layout_height="300dp"
  4. android:elevation="20dp"
  5. android:scaleType="centerCrop"
  6. attribute:curvature="50dp">
  7. <com.flaviofaria.kenburnsview.KenBurnsView
  8. android:layout_width="match_parent"
  9. android:layout_height="match_parent"
  10. android:src="@drawable/wallpaper2" ></com.flaviofaria.kenburnsview.KenBurnsView>
  11. </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.

  1. allprojects {
  2. repositories {
  3. ...
  4. maven { url "https://jitpack.io" }
  5. }
  6. }

Add below lines in build.gradle at app level.

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

Basic Usage

For a working implementation, see /app folder

ImageView

  1. <developer.shivam.crescento.ImageView android:id="@+id/crescentoImageView"
  2. android:layout_width="match_parent"
  3. android:layout_height="300dp"
  4. android:elevation="20dp"
  5. android:scaleType="centerCrop"
  6. attribute:gravity="top"
  7. attribute:curvature="50dp"
  8. attribute:crescentoTintMode="manual"
  9. attribute:crescentoTintColor="#FFFFFF"
  10. attribute:tintAlpha="50" ></developer.shivam.crescento.ImageView>

Container

  1. <developer.shivam.crescento.Container android:id="@+id/crescentoContainer"
  2. android:layout_width="match_parent"
  3. android:layout_height="300dp"
  4. android:elevation="20dp"
  5. attribute:curvature="50dp">
  6. <!-- Your code here -->
  7. </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 dr.droid27@gmail.com. Expected package would be 6 lpa.

License

  1. MIT License
  2. Copyright (c) 2016 Shivam Satija
  3. Permission is hereby granted, free of charge, to any person obtaining a copy
  4. of this software and associated documentation files (the "Software"), to deal
  5. in the Software without restriction, including without limitation the rights
  6. to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  7. copies of the Software, and to permit persons to whom the Software is
  8. furnished to do so, subject to the following conditions:
  9. The above copyright notice and this permission notice shall be included in all
  10. copies or substantial portions of the Software.
  11. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  12. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  13. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  14. AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  15. LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  16. OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  17. SOFTWARE.