Skip to content

Commit

Permalink
Making the selection listener un-mandatory
Browse files Browse the repository at this point in the history
  • Loading branch information
MuhammedRefaat committed Nov 6, 2019
1 parent 5d85038 commit 25f426d
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions app/src/main/java/com/imagine/colorpalette/ColorPalette.java
Original file line number Diff line number Diff line change
Expand Up @@ -314,10 +314,14 @@ public void setSelectedColor(int selectedColor) {

@Override
public void onClick(View v) {
String selectedColor = v.getTag().toString().trim();
selectColor(selectedColor);
setSelectedColor(Color.parseColor(selectedColor));
mListener.onColorSelected(selectedColor);
try {
String selectedColor = v.getTag().toString().trim();
selectColor(selectedColor);
setSelectedColor(Color.parseColor(selectedColor));
mListener.onColorSelected(selectedColor);
} catch (Exception ex) {
ex.printStackTrace();
}
}

/**
Expand Down

0 comments on commit 25f426d

Please sign in to comment.