docs: static void setTheme(Context context, AttributeSet attrs) {
      boolean nightModeEnabled = isNightModeEnabled(context);
  
      if (shouldSetThemeFromPreferences(context)) {
        int prefLightTheme = retrieveThemeResIdFromPreferences(context, NavigationConstants.NAVIGATION_VIEW_LIGHT_THEME);
        int prefDarkTheme = retrieveThemeResIdFromPreferences(context, NavigationConstants.NAVIGATION_VIEW_DARK_THEME);
        prefLightTheme = prefLightTheme == 0 ? R.style.NavigationViewLight : prefLightTheme;
        prefDarkTheme = prefLightTheme == 0 ? R.style.NavigationViewDark : prefDarkTheme;
        context.setTheme(nightModeEnabled ? prefDarkTheme : prefLightTheme);
        return;
      }
  
      TypedArray styledAttributes = context.obtainStyledAttributes(attrs, R.styleable.NavigationView);
      int lightTheme = styledAttributes.getResourceId(R.styleable.NavigationView_navigationLightTheme,
        R.style.NavigationViewLight);
      int darkTheme = styledAttributes.getResourceId(R.styleable.NavigationView_navigationDarkTheme,
        R.style.NavigationViewDark);
      styledAttributes.recycle();
  
      context.setTheme(nightModeEnabled ? darkTheme : lightTheme);
    }