Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Customisation is also available through xml attributes:
app:mm_color="color" // Color of drawable
app:mm_visible="boolean" // Visible
app:mm_transformDuration="integer" // Transformation animation duration
app:mm_scale="integer" // Scale factor of drawable
app:mm_scale="float" // Scale factor of drawable
app:mm_strokeWidth="integer" // Stroke width of icons (can only be 1, 2 or 3)
app:mm_rtlEnabled="boolean" // Enabled RTL layout support (flips all drawables)
app:mm_iconState="enum" // Set the intial state of the drawable (burger, arrow, x or check)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ protected static Stroke valueOf(int strokeWidth) {
}

public static final int DEFAULT_COLOR = Color.WHITE;
public static final int DEFAULT_SCALE = 1;
public static final float DEFAULT_SCALE = 1f;
public static final int DEFAULT_TRANSFORM_DURATION = 800;
public static final boolean DEFAULT_VISIBLE = true;

Expand Down Expand Up @@ -189,7 +189,7 @@ public MaterialMenuDrawable(Context context, int color, Stroke stroke, int trans
this(context, color, stroke, DEFAULT_SCALE, transformDuration);
}

public MaterialMenuDrawable(Context context, int color, Stroke stroke, int scale, int transformDuration) {
public MaterialMenuDrawable(Context context, int color, Stroke stroke, float scale, int transformDuration) {
Resources resources = context.getResources();
// convert each separately due to various densities
this.dip1 = dpToPx(resources, 1) * scale;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ private void init(Context context, AttributeSet attributeSet) {
try {
int color = attr.getColor(R.styleable.MaterialMenuView_mm_color, DEFAULT_COLOR);
boolean visible = attr.getBoolean(R.styleable.MaterialMenuView_mm_visible, DEFAULT_VISIBLE);
int scale = attr.getInteger(R.styleable.MaterialMenuView_mm_scale, DEFAULT_SCALE);
float scale = attr.getFloat(R.styleable.MaterialMenuView_mm_scale, DEFAULT_SCALE);
int transformDuration = attr.getInteger(R.styleable.MaterialMenuView_mm_transformDuration, DEFAULT_TRANSFORM_DURATION);
Stroke stroke = Stroke.valueOf(attr.getInteger(R.styleable.MaterialMenuView_mm_strokeWidth, 0));
boolean rtlEnabled = attr.getBoolean(R.styleable.MaterialMenuView_mm_rtlEnabled, false);
Expand Down
2 changes: 1 addition & 1 deletion library/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<declare-styleable name="MaterialMenuView">
<attr name="mm_color" format="color"/>
<attr name="mm_visible" format="boolean"/>
<attr name="mm_scale" format="integer"/>
<attr name="mm_scale" format="float"/>
<attr name="mm_transformDuration" format="integer"/>
<attr name="mm_strokeWidth" format="integer"/>
<attr name="mm_rtlEnabled" format="boolean"/>
Expand Down