mirror of
https://github.com/iSoron/uhabits.git
synced 2025-12-06 01:08:50 -06:00
Fix NPE in HabitCardView.triggerRipple
This commit is contained in:
@@ -143,12 +143,13 @@ public class HabitCardView extends FrameLayout
|
||||
updateBackground(isSelected);
|
||||
}
|
||||
|
||||
public void triggerRipple(long timestamp)
|
||||
public synchronized void triggerRipple(long timestamp)
|
||||
{
|
||||
long today = DateUtils.getStartOfToday();
|
||||
long day = DateUtils.millisecondsInOneDay;
|
||||
int offset = (int) ((today - timestamp) / day) - dataOffset;
|
||||
CheckmarkButtonView button = checkmarkPanel.indexToButton(offset);
|
||||
if (button == null) return;
|
||||
|
||||
float y = button.getHeight() / 2.0f;
|
||||
float x = checkmarkPanel.getX() + button.getX() + button.getWidth() / 2;
|
||||
|
||||
Reference in New Issue
Block a user