]> git.ktnx.net Git - mobile-ledger-staging.git/blobdiff - app/src/main/java/net/ktnx/mobileledger/ui/HueRing.java
fix many lint errors/warnings
[mobile-ledger-staging.git] / app / src / main / java / net / ktnx / mobileledger / ui / HueRing.java
index 435c8c6d3c0b2244efdebea7a6817b32525d1551..71df5bb98f75a98012761b74f8ceed13dea237d9 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright © 2019 Damyan Ivanov.
+ * Copyright © 2020 Damyan Ivanov.
  * This file is part of MoLe.
  * MoLe is free software: you can distribute it and/or modify it
  * under the term of the GNU General Public License as published by
@@ -48,8 +48,8 @@ public class HueRing extends View {
     private float innerR;
     private float bandWidth;
     private float centerR;
-    private RectF centerRect = new RectF();
-    private RectF ringRect = new RectF();
+    private final RectF centerRect = new RectF();
+    private final RectF ringRect = new RectF();
     private int markerOverflow;
     private int markerStrokeWidth;
     public HueRing(Context context, @Nullable AttributeSet attrs) {
@@ -207,6 +207,10 @@ public class HueRing extends View {
         centerRect.set(-centerR, -centerR, centerR, centerR);
     }
     @Override
+    public boolean performClick() {
+        return super.performClick();
+    }
+    @Override
     public boolean onTouchEvent(MotionEvent event) {
         switch (event.getAction()) {
             case MotionEvent.ACTION_DOWN:
@@ -233,8 +237,10 @@ public class HueRing extends View {
                         hue));
                 setHue(hue);
                 break;
+            case MotionEvent.ACTION_UP:
+                performClick();
+                break;
         }
-
         return true;
     }
     public void setInitialHue(int initialHue) {