From 3c826cf0610367e05640adbff2843bced43c29da Mon Sep 17 00:00:00 2001 From: Rodolfo Navalon Date: Wed, 17 Aug 2016 21:28:56 -0400 Subject: [PATCH] Added read me and modification for the app --- README.md | 93 ++++++++++++++++++- ShapeRippleExample/build.gradle | 4 +- .../shaperipple/MainActivity.java | 25 +++++ .../src/main/res/layout/about_dialog.xml | 70 ++++++++++++++ .../src/main/res/menu/nav_menu.xml | 6 +- .../src/main/res/values/strings.xml | 5 + 6 files changed, 198 insertions(+), 5 deletions(-) create mode 100644 ShapeRippleExample/src/main/res/layout/about_dialog.xml diff --git a/README.md b/README.md index 262f5e4..202a7da 100644 --- a/README.md +++ b/README.md @@ -1 +1,92 @@ -# ShapeRipple \ No newline at end of file +Demo +====== +For a brief overview of the library you can download the app in **Google PlayStore** [**Shape Ripple apk**](https://play.google.com/store/apps/details?id=com.rodolfonavalon.shaperipple) and try it out. The apk code for this demo app is located in the **ShapeRippleExample folder** + +![alt tag](https://media.giphy.com/media/14jherDI1K2Yww/giphy.gif) + +Features +======= + +- Ripple effect +- Random ripple colors +- Random ripple position +- Loaded with 4 different shapes +- Create customizable shapes +- Modify duration and interval of ripples + +All Available Attributes +======= +`ripple_color` - **color** *color of the base ripple* + +`enable_single_ripple` - **boolean** *flag for enabling the single ripple only* + +`ripple_duration` - **millisecond** *the duration of each ripple animation* + +`enable_color_transition` - **boolean** *flag for enabling the color transition* + +`enable_random_position` - **boolean** *flag for enabling the random positining of ripple in the view* + +`enable_random_color` - **boolean** *flag for enabling the random coloring for each ripple* + +`ripple_from_color` - **color** *starting color for the color transition of the ripple* + +`ripple_to_color` - **color** *end color for the color transition of the ripple* + +`ripple_stroke_width` - **dimension** *base stroke width for each of the ripple* + + +Usage +======= +You can select which options you want to use: + +**1. JCenter dependency(Recommended)** + +- Add it to your app `build.gradle`: + +```gradle +dependencies { + compile 'com.rodolfonavalon:ShapeRippleLibrary:0.1.0' +} +``` + +**2. Gradle maven dependency** + +- Add it to your app `build.gradle`: + +```gradle +repositories { + maven { + url 'https://dl.bintray.com/nuuneoi/maven/' + } +} + +... + +dependencies { + compile 'com.rodolfonavalon:ShapeRippleLibrary:0.1.0' +} +``` + +**3. Clone whole repository** + - Open your **commandline-input** and navigate to the desired destination folder on your machine (where you want to place the library) + - Use the command `https://github.com/poldz123/ShapeRipple.git` to download the full ShapeRipple repository to your computer (this includes the folder of the library as well as the folder of the example project) + - Import the library folder (`ShapeRippleLibrary`) into Android Studio (recommended) or your Eclipse workspace + - Add it as a reference to your project: + - [referencing library projects in Eclipse](http://developer.android.com/tools/projects/projects-eclipse.html#ReferencingLibraryProject) + - [managing projects from Android Studio](https://developer.android.com/sdk/installing/create-project.html) + +License +======= +Copyright 2016 Rodolfo Navalon + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. \ No newline at end of file diff --git a/ShapeRippleExample/build.gradle b/ShapeRippleExample/build.gradle index f360fd3..b1d348c 100644 --- a/ShapeRippleExample/build.gradle +++ b/ShapeRippleExample/build.gradle @@ -8,8 +8,8 @@ android { applicationId "com.rodolfonavalon.shaperipple" minSdkVersion 11 targetSdkVersion 23 - versionCode 1 - versionName "1.0" + versionCode 2 + versionName "0.1.0" } buildTypes { release { diff --git a/ShapeRippleExample/src/main/java/com/rodolfonavalon/shaperipple/MainActivity.java b/ShapeRippleExample/src/main/java/com/rodolfonavalon/shaperipple/MainActivity.java index 7034b77..d7fdfc9 100644 --- a/ShapeRippleExample/src/main/java/com/rodolfonavalon/shaperipple/MainActivity.java +++ b/ShapeRippleExample/src/main/java/com/rodolfonavalon/shaperipple/MainActivity.java @@ -1,18 +1,23 @@ package com.rodolfonavalon.shaperipple; +import android.content.Intent; import android.content.res.Configuration; import android.graphics.drawable.ColorDrawable; +import android.net.Uri; import android.os.Bundle; import android.os.PersistableBundle; import android.support.design.widget.NavigationView; import android.support.v4.widget.DrawerLayout; import android.support.v7.app.ActionBarDrawerToggle; +import android.support.v7.app.AlertDialog; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.AppCompatCheckBox; import android.support.v7.widget.Toolbar; +import android.view.LayoutInflater; import android.view.MenuItem; import android.view.View; import android.widget.CompoundButton; +import android.widget.TextView; import com.rodolfonavalon.shaperipplelibrary.ShapeRipple; import com.rodolfonavalon.shaperipplelibrary.model.Circle; @@ -112,6 +117,26 @@ public boolean onNavigationItemSelected(MenuItem item) { case R.id.nav_star: ripple.setRippleShape(new Star()); break; + case R.id.nav_github: + Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://github.com/poldz123/ShapeRipple")); + startActivity(browserIntent); + break; + case R.id.nav_about: + + View layout = LayoutInflater.from(MainActivity.this).inflate(R.layout.about_dialog, null, false); + TextView version = (TextView) layout.findViewById(R.id.version); + + version.setText(String.format("Version %s", MainActivity.this.getString(R.string.version))); + AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this); + builder.setPositiveButton("Ok", null); + builder.setView(layout); + + final AlertDialog dialog = builder.create(); + dialog.setCanceledOnTouchOutside(true); + dialog.setCancelable(true); + dialog.show(); + + break; } diff --git a/ShapeRippleExample/src/main/res/layout/about_dialog.xml b/ShapeRippleExample/src/main/res/layout/about_dialog.xml new file mode 100644 index 0000000..cde5e7c --- /dev/null +++ b/ShapeRippleExample/src/main/res/layout/about_dialog.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ShapeRippleExample/src/main/res/menu/nav_menu.xml b/ShapeRippleExample/src/main/res/menu/nav_menu.xml index 718a79b..26b5903 100644 --- a/ShapeRippleExample/src/main/res/menu/nav_menu.xml +++ b/ShapeRippleExample/src/main/res/menu/nav_menu.xml @@ -26,8 +26,10 @@ - - + + \ No newline at end of file diff --git a/ShapeRippleExample/src/main/res/values/strings.xml b/ShapeRippleExample/src/main/res/values/strings.xml index c57e12d..2cf6acf 100644 --- a/ShapeRippleExample/src/main/res/values/strings.xml +++ b/ShapeRippleExample/src/main/res/values/strings.xml @@ -9,4 +9,9 @@ Star Ripple Ripples + 0.1.0 + + It is a library that renders an awesome ripple effect with an ability to customize the shapes. + \n\nIt can do a lot of things such as random colors, random position, enable single ripple and more to come in the future. +