diff --git a/lawnchair/src/app/lawnchair/util/preferences/PrefManager.kt b/lawnchair/src/app/lawnchair/util/preferences/PrefManager.kt index 8630b81af7..d9eb76a876 100644 --- a/lawnchair/src/app/lawnchair/util/preferences/PrefManager.kt +++ b/lawnchair/src/app/lawnchair/util/preferences/PrefManager.kt @@ -2,25 +2,27 @@ package app.lawnchair.util.preferences import android.content.Context import android.content.SharedPreferences +import com.android.launcher3.LauncherAppState import com.android.launcher3.Utilities class PrefManager(context: Context) { val sp: SharedPreferences = Utilities.getPrefs(context) private val lp = LawnchairPreferences - var iconPackPackage by StringPrefDelegate(LawnchairPreferences.ICON_PACK_PACKAGE, "") + private val idp = LauncherAppState.getIDP(context) + var iconPackPackage by StringPrefDelegate(lp.ICON_PACK_PACKAGE, "") var allowRotation by BoolPrefDelegate("pref_allowRotation", true) - var wrapAdaptiveIcons by BoolPrefDelegate(LawnchairPreferences.WRAP_ADAPTIVE_ICONS, false) + var wrapAdaptiveIcons by BoolPrefDelegate(lp.WRAP_ADAPTIVE_ICONS, false) var addIconToHome by BoolPrefDelegate("pref_add_icon_to_home", true) - var hotseatColumns by FloatPrefDelegate(LawnchairPreferences.HOTSEAT_COLUMNS, 5F) - var workspaceColumns by FloatPrefDelegate(LawnchairPreferences.WORKSPACE_COLUMNS, 5F) - var workspaceRows by FloatPrefDelegate(LawnchairPreferences.WORKSPACE_ROWS, 7F) - var folderColumns by FloatPrefDelegate(LawnchairPreferences.FOLDER_COLUMNS, 3F) - var folderRows by FloatPrefDelegate(LawnchairPreferences.FOLDER_ROWS, 4F) - var iconSizeFactor by FloatPrefDelegate(LawnchairPreferences.ICON_SIZE_FACTOR, 1F) - var textSizeFactor by FloatPrefDelegate(LawnchairPreferences.TEXT_SIZE_FACTOR, 1F) - var allAppsIconSizeFactor by FloatPrefDelegate(LawnchairPreferences.ALL_APPS_ICON_SIZE_FACTOR, 1F) - var allAppsTextSizeFactor by FloatPrefDelegate(LawnchairPreferences.ALL_APPS_TEXT_SIZE_FACTOR, 1F) - var allAppsColumns by FloatPrefDelegate(LawnchairPreferences.ALL_APPS_COLUMNS, 5F) - var allowEmptyPages by BoolPrefDelegate(LawnchairPreferences.ALLOW_EMPTY_PAGES, false) - var makeColoredBackgrounds by BoolPrefDelegate(LawnchairPreferences.MAKE_COLORED_BACKGROUNDS, false) + var hotseatColumns by FloatPrefDelegate(lp.HOTSEAT_COLUMNS, idp.numHotseatIcons.toFloat()) + var workspaceColumns by FloatPrefDelegate(lp.WORKSPACE_COLUMNS, idp.numColumns.toFloat()) + var workspaceRows by FloatPrefDelegate(lp.WORKSPACE_ROWS, idp.numRows.toFloat()) + var folderColumns by FloatPrefDelegate(lp.FOLDER_COLUMNS, idp.numFolderColumns.toFloat()) + var folderRows by FloatPrefDelegate(lp.FOLDER_ROWS, idp.numFolderRows.toFloat()) + var iconSizeFactor by FloatPrefDelegate(lp.ICON_SIZE_FACTOR, 1F) + var textSizeFactor by FloatPrefDelegate(lp.TEXT_SIZE_FACTOR, 1F) + var allAppsIconSizeFactor by FloatPrefDelegate(lp.ALL_APPS_ICON_SIZE_FACTOR, 1F) + var allAppsTextSizeFactor by FloatPrefDelegate(lp.ALL_APPS_TEXT_SIZE_FACTOR, 1F) + var allAppsColumns by FloatPrefDelegate(lp.ALL_APPS_COLUMNS, idp.numAllAppsColumns.toFloat()) + var allowEmptyPages by BoolPrefDelegate(lp.ALLOW_EMPTY_PAGES, false) + var makeColoredBackgrounds by BoolPrefDelegate(lp.MAKE_COLORED_BACKGROUNDS, false) } \ No newline at end of file