Skip to content

Attributes and methods

AlekSt7 edited this page Nov 7, 2021 · 11 revisions

XML Attributes

This library has many attributes for customizing via XML. Here is a list of XML attrs:

Attribute Data type Description
colorPointerRad float Radius of color pointer
excPointerRad float Radius of external color pointer
backgroundRad float Radius of background
bgColor color Color of background
pointerRad float Radius of pointer
badgeSize float Size of badge
colorRingRad float Radius of color ring
colorRingThickness float Thickness of color ring
placemarksRad float Radius of placemarks
placemarksCount integer Count of placemarks
colorPointerCustomColor color User color of color pointer
pointerCustomColor color User color of pointer
isPointerCustomColor boolean Whether a custom color is used in the pointer
isColorPointerCustomColor boolean Whether a custom color is used in the color pointer
isPointerLine boolean Hides or shows the pointer line on view
isPointerOutline boolean Hides or shows the outline on pointer
isPointerShadow boolean Hides or shows the shadow on pointer
isBackground boolean Hides or shows the background on view
isExColorPointer boolean Hides or shows the external color pointer on view
isPlacemarks boolean Hides or shows the placemarks on view
isPlacemarksRound boolean Will a circle be drawn around the placemarks
isColorPointer boolean Hides or shows the color pointer on view
isColorPointerShadow boolean Hides or shows a shadow on color pointer
isBadge boolean Hides or shows the badge on color pointer
isRoundBadge boolean Makes the badge round
isShadow boolean Hides or shows the shadow on background
stepperMode boolean Is stepper mode used. Stepper mode works only when placemarks are on. Allows the pointer to move only along the placemarks
badge reference Path to the image used by the badge

Main structure

For a simple understanding of the customization attributes, I depicted the structure of the RXColorWheel elements

color wheel promo en

Interfaces

  /** Interface definition for a callback which to be invoked when the color changes. */
  interface ColorChagneListener{

        /**
         * Called when the color changes.
         *
         * @param color The current color.
         */
        void onColorChanged(int color);

        /**
         * Called when the view was rendered for the first time.
         *
         * @param color The current color.
         */
        void firstDraw(int color);
    }

    /** Interface definition for a callback which to be invoked when the buttons are pressed. */
    interface ButtonTouchListener{

        void on_cPointerTouch();

        void on_excPointerTouch();

    }

    /** Interface definition for a callback which to be invoked when switching a step of stepper mode to the next value. */
    interface StepperListener{

        void onStep();

    }

Public methods

Method Definition
boolean setColor(int color) Sets color on color wheel. Returns true if the passed color is in the color gamut of the color ring.
void setButtonTouchListener(@NonNull ButtonTouchListener listener) A callback method that takes an implementation of the ButtonTouchListener interface
void setColorChangeListener(@NonNull ColorChagneListener listener) A callback method that takes an implementation of the ColorChangeListener interface
void setStepperListener(@NonNull StepperListener listener) A callback method that takes an implementation of the StepperListener interface
void setColorPalette(int colors[]) Sets the color palette on color ring
void setIsColorPointer(boolean isColorPointer) Sets the isColorPointer
void setColorPointerCustomColor(int color) Sets the colorPointerCustomColor
void setColorPointerCustomColor(String color) Sets the colorPointerCustomColor
void setIsColorPointerCustomColor(boolean isColorPointerCustomColor) Sets default color of color pointer, if the passed value is true, sets the value of an attribute isColorPointerCustomColor
void setPointerCustomColor(int color) Sets the pointerCustomColor
void setPointerCustomColor(String color) Sets the pointerCustomColor
void setIsPointerCustomColor(boolean isPointerCustomColor) Sets default color of pointer, if the passed value is true, sets the value of an attribute isPointerCustomColor
void setColorPointerRadius(float colorPointerRadius) Sets the colorPointerRad
void setIsBadge(boolean isBadge) Sets the isBadge
void setIsRoundBadge(boolean isRoundBadge) Sets the isRoundBadge
void setBadgeSize(float badge_size) Sets the badgeSize
void setImageBitmap(Bitmap bitmap) Sets the bitmap of image use by badge
void setImageById(Context context, int drawableId) Sets the image by drawable id use by badge
void setIsExColorPointer(boolean isExColorPointer) Sets the isExColorPointer
void setExColorPointerRadius(float ExColorPointerRadius) Sets the excPointerRad
void setBackgroundColor(int color) Sets the bgColor
void setIsBackground(boolean background) Sets the isBackgorund
void setIsPointerLine(boolean isPointerLine) Sets the isPointerLine
void setIsPointerShadow(boolean isPointerShadow) Sets the isPointerShadow
void setIsPlacemarks(boolean isPlacemarks) Sets the isPlacemarks
void setIsPlacemarksRound(boolean isPlacemarksRound) Sets the isPlacemarksRound
void setPlacemarksCount(int count) Sets the placemarksCount
void setColorRingRadius(float colorRingRadius) Sets the colorRingRad
void setColorRingThickness(float colorRingThickness) Sets the colorRingThickness
void setIsColorPointerShadow(boolean isColorPointerShadow) Sets the isColorPointerShadow
void setPointerRadius(float pointerRadius) Sets the pointerRad
void setIsPointerOutline(boolean isPointerOutline) Sets the isPointerOutline
void setStepperMode(boolean stepperMode) Sets the stepperMode
int[] getColor_palette() Returns the color palette used by color ring
boolean getIsColorPointer() Returns the isColorPointer
boolean getIsColorPointerCustomColor() Returns the isColorPointerCustomColor
int getColorPointerCustomColor() Returns the colorPointerCustomColor
boolean getIsPointerCustomColor() Returns isPointerCustomColor
int getPointerCustomColor() Returns the pointerCustomColor
float getColorPointerRadius() Returns the colorPointerRad
boolean getIsBadge() Returns the isBadge
boolean getIsRoundBadge() Returns the isRoundBadge
float getBadgeSize() Returns the badgeSize
Bitmap getImageBitmap() Returns the bitmap of the image used by the badge
boolean getIsExColorPointer() Returns the isExColorPointer
float getExColoPointerRadius() Returns the excPointerRad
int getBackgroundColor() Returns the bgColor
boolean getIsBackground() Returns the isBackgorund
boolean getIsPointerLine() Returns the isPointerLine
boolean getIsPointerShadow() Returns the isPointerShadow
boolean getIsPlacemarks() Returns the isPlacemarks
boolean getIsPlacemarksRound() Returns the isPlacemarksRound
int getPlacemarksCount() Returns the placemarksCount
float getColorRingRadius() Returns the colorRingRad
float getColorRingThickness() Returns the colorRingThickness
boolean getIsColorPointerShadow() Returns the isColorPointerShadow
float getPointerRadius() Returns the pointerRad
boolean getIsPointerOutline() Returns the isPointerOutline
boolean getStepperMode() Returns the stepperMode
Clone this wiki locally