Skip to content

Commit

Permalink
Merge branch 'release/1.8'
Browse files Browse the repository at this point in the history
  • Loading branch information
keyboardsurfer committed Apr 28, 2013
2 parents 6a7ee8b + fe38148 commit 8f16606
Show file tree
Hide file tree
Showing 19 changed files with 638 additions and 377 deletions.
25 changes: 0 additions & 25 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -175,28 +175,3 @@
of your accepting any such warranty or additional liability.

END OF TERMS AND CONDITIONS

APPENDIX: How to apply the Apache License to your work.

To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright [yyyy] [name of copyright owner]

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.
13 changes: 13 additions & 0 deletions NOTICE
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Crouton
Copyright 2012 - 2013 Benjamin Weiss

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
13 changes: 11 additions & 2 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,16 @@ You can check some features in the Crouton Demo.
If you're already using Crouton and just want to download the latest version of the library, follow [this link](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22de.keyboardsurfer.android.widget%22).

### Changelog
#### Current version: 1.7
#### Current version: 1.8

####[1.8](https://github.com/keyboardsurfer/Crouton/tree/1.8)

- Improves support for custom views
- Smoothing out animations for multiple line Croutons
- Cleans up Style
- Configuration is now available for non-UI information
- Style only holds UI-relevant information
- Introduces DURATION_SHORT and DURATION_LONG constants

####[1.7](https://github.com/keyboardsurfer/Crouton/tree/1.7)

Expand Down Expand Up @@ -162,7 +171,7 @@ After putting Crouton in the repository you can add it as a dependency.
```xml
<dependency>
<artifactId>crouton</artifactId>
<version>1.6</version>
<version>${crouton.version}</version>
<groupId>de.keyboardsurfer.android.widget</groupId>
</dependency>
```
Expand Down
5 changes: 3 additions & 2 deletions library/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="de.keyboardsurfer.mobile.app.android.widget.crouton"
android:versionCode="1"
android:versionName="1.7"
android:minSdkVersion="4">
android:versionName="1.8">

<uses-sdk android:minSdkVersion="4" />

</manifest>
2 changes: 1 addition & 1 deletion library/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<url>https://github.com/keyboardsurfer/Crouton</url>
<artifactId>crouton</artifactId>
<groupId>de.keyboardsurfer.android.widget</groupId>
<version>1.7</version>
<version>1.8</version>
<packaging>jar</packaging>

<properties>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
/*
* Copyright 2013 Benjamin Weiss
*
* 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.
*/
package de.keyboardsurfer.android.widget.crouton;

/**
* Allows configuring a {@link Crouton}s behaviour aside from the actual view,
* which is defined via {@link Style}.
* <p/>
* This allows to re-use a {@link Style} while modifying parameters that only have to be applied
* when the {@link Crouton} is being displayed.
*
* @author chris
* @since 1.8
*/
public final class Configuration {


/**
* Display a {@link Crouton} for an infinite amount of time or
* until {@link de.keyboardsurfer.android.widget.crouton.Crouton#cancel()} has been called.
*/
public static final int DURATION_INFINITE = -1;
/** The default short display duration of a {@link Crouton}. */
public static final int DURATION_SHORT = 3000;
/** The default long display duration of a {@link Crouton}. */
public static final int DURATION_LONG = 5000;

/** The default {@link Configuration} of a {@link Crouton}. */
public static final Configuration DEFAULT;

static {
DEFAULT = new Builder().setDuration(DURATION_SHORT).build();
}

/**
* The durationInMilliseconds the {@link Crouton} will be displayed in
* milliseconds.
*/
final int durationInMilliseconds;
/** The resource id for the in animation. */
final int inAnimationResId;
/** The resource id for the out animation. */
final int outAnimationResId;

private Configuration(Builder builder) {
this.durationInMilliseconds = builder.durationInMilliseconds;
this.inAnimationResId = builder.inAnimationResId;
this.outAnimationResId = builder.outAnimationResId;
}

/** Creates a {@link Builder} to build a {@link Configuration} upon. */
public static class Builder {
private int durationInMilliseconds = DURATION_SHORT;
private int inAnimationResId = 0;
private int outAnimationResId = 0;

/**
* Set the durationInMilliseconds option of the {@link Crouton}.
*
* @param duration
* The durationInMilliseconds the crouton will be displayed
* {@link Crouton} in milliseconds.
*
* @return the {@link Builder}.
*/
public Builder setDuration(final int duration) {
this.durationInMilliseconds = duration;

return this;
}

/**
* The resource id for the in animation.
*
* @param inAnimationResId
* The resource identifier for the animation that's being shown
* when the {@link Crouton} is going to be displayed.
*
* @return the {@link Builder}.
*/
public Builder setInAnimation(final int inAnimationResId) {
this.inAnimationResId = inAnimationResId;

return this;
}

/**
* The resource id for the out animation
*
* @param outAnimationResId
* The resource identifier for the animation that's being shown
* when the {@link Crouton} is going to be removed.
*
* @return the {@link Builder}.
*/
public Builder setOutAnimation(final int outAnimationResId) {
this.outAnimationResId = outAnimationResId;

return this;
}

/**
* Builds the {@link Configuration}.
*
* @return The built {@link Configuration}.
*/
public Configuration build() {
return new Configuration(this);
}
}

@Override
public String toString() {
return "Configuration{" +
"durationInMilliseconds=" + durationInMilliseconds +
", inAnimationResId=" + inAnimationResId +
", outAnimationResId=" + outAnimationResId +
'}';
}
}
Loading

0 comments on commit 8f16606

Please sign in to comment.