diff app/src/main/java/com/five_ten_sg/connectbot/util/UberColorPickerDialog.java @ 457:105815cce146 stable-1.9.3-3

minimum version android 5, target and compile version api 28
author Carl Byington <carl@five-ten-sg.com>
date Tue, 29 Jan 2019 11:21:57 -0800
parents d29cce60f393
children
line wrap: on
line diff
--- a/app/src/main/java/com/five_ten_sg/connectbot/util/UberColorPickerDialog.java	Sat Nov 10 12:18:05 2018 -0800
+++ b/app/src/main/java/com/five_ten_sg/connectbot/util/UberColorPickerDialog.java	Tue Jan 29 11:21:57 2019 -0800
@@ -52,7 +52,6 @@
 import android.graphics.drawable.GradientDrawable.Orientation;
 import android.os.Bundle;
 import android.util.DisplayMetrics;
-import android.util.FloatMath;
 import android.view.MotionEvent;
 import android.view.View;
 
@@ -492,8 +491,8 @@
             setVerValSlider();
             float angle = 2 * PI - mHSV[0] / (180 / 3.1415927f);
             float radius = mHSV[1] * PALETTE_RADIUS;
-            mCoord[0] = (int)(FloatMath.cos(angle) * radius);
-            mCoord[1] = (int)(FloatMath.sin(angle) * radius);
+            mCoord[0] = (int)(Math.cos(angle) * radius);
+            mCoord[1] = (int)(Math.sin(angle) * radius);
             mCoord[2] = PALETTE_DIM - (int)(mHSV[2] * PALETTE_DIM);
         }
 
@@ -731,7 +730,7 @@
             else if (mCoord[1] > PALETTE_RADIUS)
                 mCoord[1] = PALETTE_RADIUS;
 
-            float radius = FloatMath.sqrt(mCoord[0] * mCoord[0] + mCoord[1] * mCoord[1]);
+            float radius = (float)Math.sqrt(mCoord[0] * mCoord[0] + mCoord[1] * mCoord[1]);
 
             if (radius > PALETTE_RADIUS)
                 radius = PALETTE_RADIUS;
@@ -744,8 +743,8 @@
                 unit += 1;
             }
 
-            mCoord[0] = round(FloatMath.cos(angle) * radius);
-            mCoord[1] = round(FloatMath.sin(angle) * radius);
+            mCoord[0] = round(Math.cos(angle) * radius);
+            mCoord[1] = round(Math.sin(angle) * radius);
             int c = interpColor(mSpectrumColorsRev, unit);
             float[] hsv = new float[3];
             Color.colorToHSV(c, hsv);
@@ -850,7 +849,7 @@
             boolean inSwatchOld = ptInRect(round(x), round(y), mOldSwatchRect);
             boolean inSwatchNew = ptInRect(round(x), round(y), mNewSwatchRect);
             //Get the event's distance from the center of the main 2D palette
-            float radius = FloatMath.sqrt(circlePinnedX * circlePinnedX + circlePinnedY * circlePinnedY);
+            float radius = (float)Math.sqrt(circlePinnedX * circlePinnedX + circlePinnedY * circlePinnedY);
             //Is the event in a circle-pinned 2D palette?
             boolean inOvalPalette = radius <= PALETTE_RADIUS;
 
@@ -896,8 +895,8 @@
                             unit += 1;
                         }
 
-                        mCoord[0] = round(FloatMath.cos(angle) * radius);
-                        mCoord[1] = round(FloatMath.sin(angle) * radius);
+                        mCoord[0] = round(Math.cos(angle) * radius);
+                        mCoord[1] = round(Math.sin(angle) * radius);
                         int c = interpColor(mSpectrumColorsRev, unit);
                         float[] hsv = new float[3];
                         Color.colorToHSV(c, hsv);