Skip to content

Commit

Permalink
dynamic sizing
Browse files Browse the repository at this point in the history
  • Loading branch information
milindrc committed Dec 30, 2019
1 parent 7de75e6 commit 7157724
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 4 additions & 2 deletions mosaic/src/main/java/com/matrixdev/mosaic/MosaicView.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ public class MosaicView extends View {
private int maxScrollX;
private int horzLim;

private final int halfOffset = 40;
private final int fullOffset = 80;
private int halfOffset = 60;
private int fullOffset = 120;
private int leftDistance;
private int rightDistance;
private int midX;
Expand Down Expand Up @@ -91,6 +91,8 @@ public MosaicView(Context context, AttributeSet attrs) {
isFadeEnabled = attributes.getBoolean(R.styleable.MosaicView_isFadeEnabled, true);
isShrinkEnabled = attributes.getBoolean(R.styleable.MosaicView_isShrinkEnabled, true);
defaultColor = attributes.getColor(R.styleable.MosaicView_imageBackground, Color.WHITE);
fullOffset = attributes.getInteger(R.styleable.MosaicView_fullSize, 100);
halfOffset = attributes.getColor(R.styleable.MosaicView_halfSize, 50);

attributes.recycle();
}
Expand Down
2 changes: 2 additions & 0 deletions mosaic/src/main/res/values/attrs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
<attr name="isFadeEnabled" format="boolean"/>
<attr name="isShrinkEnabled" format="boolean"/>
<attr name="imageBackground" format="color"/>
<attr name="fullSize" format="integer"/>
<attr name="halfSize" format="integer"/>


</declare-styleable>
Expand Down

0 comments on commit 7157724

Please sign in to comment.