From 960f159a31f623b3e46d13e40d8dcfece3940c27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=8D=E3=82=80=E3=81=AD=E3=81=93?= Date: Thu, 14 Dec 2023 10:18:24 +0900 Subject: [PATCH] =?UTF-8?q?Impl=E5=AE=9F=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lacerta/utils/impl/SharedPrefUtilsImpl.java | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/utils/src/main/java/one/nem/lacerta/utils/impl/SharedPrefUtilsImpl.java b/utils/src/main/java/one/nem/lacerta/utils/impl/SharedPrefUtilsImpl.java index 81dfe923..f976b46b 100644 --- a/utils/src/main/java/one/nem/lacerta/utils/impl/SharedPrefUtilsImpl.java +++ b/utils/src/main/java/one/nem/lacerta/utils/impl/SharedPrefUtilsImpl.java @@ -1,17 +1,29 @@ package one.nem.lacerta.utils.impl; + +import android.content.Context; import android.content.SharedPreferences; +import dagger.hilt.android.qualifiers.ApplicationContext; import one.nem.lacerta.utils.repository.SharedPrefUtils; public class SharedPrefUtilsImpl implements SharedPrefUtils{ + + private final Context applicationContext; + + public SharedPrefUtilsImpl(@ApplicationContext Context applicationContext) { + this.applicationContext = applicationContext; + } + @Override public SharedPreferences.Editor getEditor() { - return null; + // Editorの取得 + return applicationContext.getSharedPreferences("common", Context.MODE_PRIVATE).edit(); // TODO-rca: 決め打ちやめる? } @Override public SharedPreferences.Editor getEditor(String name) { - return null; + // Editorの取得 + return applicationContext.getSharedPreferences(name, Context.MODE_PRIVATE).edit(); } }