/** * Sets the display mode. * * @param displayMode the mode to set */ public synchronized void setDisplayMode(BookShelfFragment.DisplayMode displayMode) { sp.edit().putString(PREF_KEY_DISPLAY_MODE, displayMode.name()).apply(); }
/** @return the display mode that has been set or the default. */ public synchronized BookShelfFragment.DisplayMode getDisplayMode() { return BookShelfFragment.DisplayMode.valueOf( sp.getString(PREF_KEY_DISPLAY_MODE, BookShelfFragment.DisplayMode.GRID.name())); }