Class ThemeSwitcher
-
- All Implemented Interfaces:
public class ThemeSwitcherThis class is used to switch theme colors in NavigationView.
-
-
Constructor Summary
Constructors Constructor Description ThemeSwitcher()
-
Method Summary
Modifier and Type Method Description static BitmapretrieveThemeMapMarker(@NonNull() Context context)Returns a map marker Bitmap based on the current theme setting. static intretrieveAttrResourceId(@NonNull() Context context, int attrId, int defaultResId)Looks at current theme and retrieves the resource for the given attrId set in the theme. static voidsetTheme(@NonNull() Context context, AttributeSet attrs)Called in onCreate() to check the UI Mode (day or night) and set the theme colors accordingly. static StringretrieveMapStyle(@NonNull() Context context)
-
-
-
Method Detail
-
retrieveThemeMapMarker
@Nullable() static Bitmap retrieveThemeMapMarker(@NonNull() Context context)
Returns a map marker Bitmap based on the current theme setting.
- Parameters:
context- to retrieve the drawable for the given resource ID
-
retrieveAttrResourceId
static int retrieveAttrResourceId(@NonNull() Context context, int attrId, int defaultResId)
Looks at current theme and retrieves the resource for the given attrId set in the theme.
- Parameters:
context- to retrieve the resolved attributeattrId- for the given attribute Id
-
setTheme
static void setTheme(@NonNull() Context context, AttributeSet attrs)
Called in onCreate() to check the UI Mode (day or night) and set the theme colors accordingly.
- Parameters:
context- NavigationView where the theme will be setattrs- holding custom styles if any are set
-
retrieveMapStyle
@NonNull() static String retrieveMapStyle(@NonNull() Context context)
-
-