Package com.kernelcrew.moodapp.ui
Class EmotionIconUtils
java.lang.Object
com.kernelcrew.moodapp.ui.EmotionIconUtils
Utility class for converting emotion names into map marker icons.
This class provides functionality to transform emotion string representations into Google Maps marker icons (BitmapDescriptors) for displaying mood events on maps. It handles the conversion of vector drawables into appropriately sized bitmap markers with proper background and formatting for each distinct emotion.
Created by Anthropic, Claude 3.7 Sonnet, "Generate JavaDoc for EmotionIconUtils", accessed 03-30-2025-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic com.google.android.gms.maps.model.BitmapDescriptor
getEmotionIcon
(Context context, String emotion) Converts an emotion name to its corresponding map marker icon.
-
Constructor Details
-
EmotionIconUtils
public EmotionIconUtils()
-
-
Method Details
-
getEmotionIcon
public static com.google.android.gms.maps.model.BitmapDescriptor getEmotionIcon(Context context, String emotion) Converts an emotion name to its corresponding map marker icon.Takes a string representation of an emotion (matching the enum values in the Emotion class) and returns a properly formatted BitmapDescriptor that can be used as a Google Maps marker icon. Each emotion has a distinct visual representation for easy identification on the map.
- Parameters:
context
- The Android context used to access resourcesemotion
- The string name of the emotion (e.g., "Happy", "Sad", "Anger")- Returns:
- A BitmapDescriptor object representing the emotion as a map marker icon
-