Skip to content

Commit

Permalink
Merge branch 'release/1.8.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
keyboardsurfer committed May 3, 2013
2 parents 7fdb4eb + 08d953e commit b6735ef
Show file tree
Hide file tree
Showing 10 changed files with 47 additions and 23 deletions.
2 changes: 1 addition & 1 deletion README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ 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.8
#### Current version: 1.8.1

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

Expand Down
2 changes: 1 addition & 1 deletion library/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="de.keyboardsurfer.mobile.app.android.widget.crouton"
android:versionCode="1"
android:versionName="1.8">
android:versionName="1.8.1">

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

Expand Down
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.8</version>
<version>1.8.1</version>
<packaging>jar</packaging>

<properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* @author chris
* @since 1.8
*/
public final class Configuration {
public class Configuration {


/**
Expand All @@ -45,10 +45,7 @@ public final class Configuration {
DEFAULT = new Builder().setDuration(DURATION_SHORT).build();
}

/**
* The durationInMilliseconds the {@link Crouton} will be displayed in
* milliseconds.
*/
/** The durationInMilliseconds the {@link Crouton} will be displayed in milliseconds. */
final int durationInMilliseconds;
/** The resource id for the in animation. */
final int inAnimationResId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public final class Crouton {
private static final int TEXT_ID = 0x101;
private final CharSequence text;
private final Style style;
private Configuration configuration = Configuration.DEFAULT;
private Configuration configuration = null;
private final View customView;

private OnClickListener onClickListener;
Expand Down Expand Up @@ -623,9 +623,7 @@ public Crouton setOnClickListener(OnClickListener onClickListener) {
* @return this {@link Crouton}.
*/
public Crouton setConfiguration(final Configuration configuration) {
if (configuration != null) {
this.configuration = configuration;
}
this.configuration = configuration;
return this;
}

Expand Down Expand Up @@ -717,6 +715,9 @@ Style getStyle() {

/** @return this croutons configuration */
Configuration getConfiguration() {
if (null == configuration) {
configuration = getStyle().configuration;
}
return configuration;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@
/** Manages the lifecycle of {@link Crouton}s. */
final class Manager extends Handler {
private static final class Messages {
private Messages() { /* no-op */
}
private Messages() { /* no-op */ }

public static final int DISPLAY_CROUTON = 0xc2007;
public static final int ADD_CROUTON_TO_VIEW = 0xc20074dd;
Expand Down Expand Up @@ -406,4 +405,11 @@ public static void announceForAccessibilityCompat(Context context, CharSequence
accessibilityManager.sendAccessibilityEvent(event);
}
}

@Override
public String toString() {
return "Manager{" +
"croutonQueue=" + croutonQueue +
'}';
}
}
30 changes: 25 additions & 5 deletions library/src/de/keyboardsurfer/android/widget/crouton/Style.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ public class Style {
.build();
}

/**
* The {@link Configuration} for this {@link Style}.
* It can be overridden via {@link Crouton#setConfiguration(Configuration)}.
*/
final Configuration configuration;

/**
* The resource id of the backgroundResourceId.
* <p/>
Expand Down Expand Up @@ -101,10 +107,7 @@ public class Style {
/** An additional image to display in the {@link Crouton}. */
final int imageResId;

/**
* The {@link ImageView.ScaleType} for the image to display in the
* {@link Crouton}.
*/
/** The {@link ImageView.ScaleType} for the image to display in the {@link Crouton}. */
final ImageView.ScaleType imageScaleType;

/**
Expand Down Expand Up @@ -136,6 +139,7 @@ public class Style {
final int paddingDimensionResId;

private Style(final Builder builder) {
this.configuration = builder.configuration;
this.backgroundColorResourceId = builder.backgroundColorResourceId;
this.backgroundDrawableResourceId = builder.backgroundDrawableResourceId;
this.isTileEnabled = builder.isTileEnabled;
Expand All @@ -161,6 +165,7 @@ private Style(final Builder builder) {

/** Builder for the {@link Style} object. */
public static class Builder {
private Configuration configuration;
private int backgroundColorValue;
private int backgroundColorResourceId;
private int backgroundDrawableResourceId;
Expand All @@ -185,6 +190,7 @@ public static class Builder {

/** Creates a {@link Builder} to build a {@link Style} upon. */
public Builder() {
configuration = Configuration.DEFAULT;
paddingInPixels = 10;
backgroundColorResourceId = android.R.color.holo_blue_light;
backgroundDrawableResourceId = 0;
Expand All @@ -206,6 +212,7 @@ public Builder() {
* The base {@link Style} to use for this {@link Style}.
*/
public Builder(final Style baseStyle) {
configuration = baseStyle.configuration;
backgroundColorValue = baseStyle.backgroundColorValue;
backgroundColorResourceId = baseStyle.backgroundColorResourceId;
backgroundDrawableResourceId = baseStyle.backgroundDrawableResourceId;
Expand All @@ -228,6 +235,18 @@ public Builder(final Style baseStyle) {
paddingInPixels = baseStyle.paddingInPixels;
paddingDimensionResId = baseStyle.paddingDimensionResId;
}
/**
* Set the {@link Configuration} option of the {@link Crouton}.
*
* @param configuration
* The {@link Configuration}.
*
* @return the {@link Builder}.
*/
public Builder setConfiguration(Configuration configuration) {
this.configuration = configuration;
return this;
}

/**
* Set the backgroundColorResourceId option of the {@link Crouton}.
Expand Down Expand Up @@ -464,7 +483,8 @@ public Style build() {
@Override
public String toString() {
return "Style{" +
"backgroundColorResourceId=" + backgroundColorResourceId +
"configuration=" + configuration +
", backgroundColorResourceId=" + backgroundColorResourceId +
", backgroundDrawableResourceId=" + backgroundDrawableResourceId +
", backgroundColorValue=" + backgroundColorValue +
", isTileEnabled=" + isTileEnabled +
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

<name>Crouton Parent</name>
<artifactId>crouton-parent</artifactId>
<version>1.8</version>
<version>1.8.1</version>
<groupId>de.keyboardsurfer.android.widget</groupId>
<packaging>pom</packaging>

Expand Down
4 changes: 2 additions & 2 deletions sample/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="de.keyboardsurfer.app.demo.crouton"
android:versionCode="10"
android:versionName="1.8" >
android:versionCode="11"
android:versionName="1.8.1" >

<uses-sdk
android:minSdkVersion="4"
Expand Down
2 changes: 1 addition & 1 deletion sample/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

<name>Crouton Demo</name>
<artifactId>de.keyboardsurfer.app.demo.crouton</artifactId>
<version>1.8</version>
<version>1.8.1</version>
<groupId>de.keyboardsurfer.app.demo.crouton</groupId>
<packaging>apk</packaging>

Expand Down

0 comments on commit b6735ef

Please sign in to comment.