Skip to content

Commit

Permalink
Fix color bug with driver picklist
Browse files Browse the repository at this point in the history
  • Loading branch information
Diego Serrano committed May 12, 2023
1 parent a3aae05 commit a0617c0
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 13 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 2.24.3 (2023-05-12)

- Fix getScoreColor bug

## 2.24.2 (2023-03-27)

- Fix crash after stopping a survey
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ If you use Maven, you can include this library as a dependency:
<dependency>
<groupId>com.wootric</groupId>
<artifactId>wootric-sdk-android</artifactId>
<version>2.24.2</version>
<version>2.24.3</version>
</dependency>
```

### Using Gradle

```xml
implementation 'com.wootric:wootric-sdk-android:2.24.2'
implementation 'com.wootric:wootric-sdk-android:2.24.3'
```

## Initializing Wootric
Expand Down
4 changes: 2 additions & 2 deletions androidsdk/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
VERSION_NAME=2.24.2
VERSION_CODE=2242
VERSION_NAME=2.24.3
VERSION_CODE=2243
GROUP=com.wootric

POM_DESCRIPTION=WootricSDK Android
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,18 @@ private void initViews() {
mDriverPicklist = (DriverPicklist) mLayoutBody.findViewById(R.id.wootric_driver_picklist);
selectedAnswers = new HashMap<>();

try {
Resources res = mContext.getResources();
mColorSelected = res.getColor(mSettings.getScoreColor());
mColorEnabled = res.getColor(mSettings.getSurveyColor());
} catch(Exception e) {
mColorSelected = mSettings.getScoreColor();
mColorEnabled = mSettings.getSurveyColor();
}

new DriverPicklist.Configure()
.driverPicklist(mDriverPicklist)
.selectedColor(mContext.getResources().getColor(mSettings.getScoreColor()))
.selectedColor(mColorSelected)
.selectedFontColor(Color.parseColor("#ffffff"))
.deselectedColor(Color.parseColor("#ffffff"))
.deselectedFontColor(Color.parseColor("#253746"))
Expand Down Expand Up @@ -397,14 +406,6 @@ private void setTexts() {
}

private void setColors() {
try {
Resources res = mContext.getResources();
mColorSelected = res.getColor(mSettings.getScoreColor());
mColorEnabled = res.getColor(mSettings.getSurveyColor());
} catch(Exception e) {
mColorSelected = mSettings.getScoreColor();
mColorEnabled = mSettings.getSurveyColor();
}
mRatingBar.setSelectedColor(mColorSelected);

mBtnDismiss.setTextColor(mColorEnabled);
Expand Down

0 comments on commit a0617c0

Please sign in to comment.