Skip to content

Commit

Permalink
Added setter methods
Browse files Browse the repository at this point in the history
If the view is initialized programmatically the user now has an option to initialize all the values that are available as attributes.
  • Loading branch information
Wrimmer committed Jan 13, 2018
1 parent 0df840d commit 25a3ef3
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
4 changes: 2 additions & 2 deletions timdicator/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ android {
defaultConfig {
minSdkVersion 14
targetSdkVersion 27
versionCode 1
versionName "1.0.0"
versionCode 3
versionName "1.0.2"
}

buildTypes {
Expand Down
28 changes: 28 additions & 0 deletions timdicator/src/main/java/com/tsurkis/timdicator/Timdicator.java
Original file line number Diff line number Diff line change
Expand Up @@ -404,4 +404,32 @@ protected void onDetachedFromWindow() {
private static float dpToPx(final Context context, final float value) {
return value * context.getResources().getDisplayMetrics().density;
}

/*
******************************************************************************************
Setters
******************************************************************************************
*/

public void setDefaultCirclePaint(Paint defaultCirclePaint) {
this.defaultCirclePaint = defaultCirclePaint;
}

public void setChosenCirclePaint(Paint chosenCirclePaint) {
this.chosenCirclePaint = chosenCirclePaint;
}

public void setCircleRadiusInDp(Context context, float circleRadiusInDp) {
this.circleRadiusInPX = dpToPx(context, circleRadiusInDp);
}

public void setDistanceBetweenCircleInDp(Context context, float distanceBetweenCircleInPX) {
this.distanceBetweenCircleInPX = dpToPx(context, distanceBetweenCircleInPX);
}

public void setNumberOfCircles(int numberOfCircles) {
this.numberOfCircles = numberOfCircles;
}
}

0 comments on commit 25a3ef3

Please sign in to comment.