diff --git a/app/src/main/java/com/ray650128/floatingwindow/utils/PreferenceUtil.kt b/app/src/main/java/com/ray650128/floatingwindow/utils/PreferenceUtil.kt index f4a9390..a696e38 100644 --- a/app/src/main/java/com/ray650128/floatingwindow/utils/PreferenceUtil.kt +++ b/app/src/main/java/com/ray650128/floatingwindow/utils/PreferenceUtil.kt @@ -14,6 +14,7 @@ object PreferenceUtil { private const val Y_AXIS_OFFSET = "Y_AXIS_OFFSET" private const val GRAVITY = "GRAVITY" private const val ICON = "ICON" + private const val ICON_PATH = "ICON_PATH" private val sharedPreferences = MyApp.appContext.getSharedPreferences(MAIN_KEY, Context.MODE_PRIVATE) @@ -32,4 +33,8 @@ object PreferenceUtil { var icon: Int get() = sharedPreferences.getInt(ICON, R.drawable.ic_chicken) set(value) = sharedPreferences.edit().putInt(ICON, value).apply() + + var iconPath: String? + get() = sharedPreferences.getString(ICON_PATH, "") + set(value) = sharedPreferences.edit().putString(ICON_PATH, value).apply() } \ No newline at end of file diff --git a/app/src/main/res/layout/activity_setting.xml b/app/src/main/res/layout/activity_setting.xml index 6f5da0b..da0ab2f 100644 --- a/app/src/main/res/layout/activity_setting.xml +++ b/app/src/main/res/layout/activity_setting.xml @@ -129,4 +129,23 @@ app:layout_constraintStart_toEndOf="@+id/textView7" app:layout_constraintTop_toBottomOf="@+id/edYOffset" /> + + +