mirror of
https://github.com/lacerta-doc/Lacerta.git
synced 2024-11-23 00:13:16 +00:00
Impl実装
This commit is contained in:
parent
922168c86b
commit
960f159a31
|
@ -1,17 +1,29 @@
|
||||||
package one.nem.lacerta.utils.impl;
|
package one.nem.lacerta.utils.impl;
|
||||||
|
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
|
|
||||||
|
import dagger.hilt.android.qualifiers.ApplicationContext;
|
||||||
import one.nem.lacerta.utils.repository.SharedPrefUtils;
|
import one.nem.lacerta.utils.repository.SharedPrefUtils;
|
||||||
|
|
||||||
public class SharedPrefUtilsImpl implements SharedPrefUtils{
|
public class SharedPrefUtilsImpl implements SharedPrefUtils{
|
||||||
|
|
||||||
|
private final Context applicationContext;
|
||||||
|
|
||||||
|
public SharedPrefUtilsImpl(@ApplicationContext Context applicationContext) {
|
||||||
|
this.applicationContext = applicationContext;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SharedPreferences.Editor getEditor() {
|
public SharedPreferences.Editor getEditor() {
|
||||||
return null;
|
// Editorの取得
|
||||||
|
return applicationContext.getSharedPreferences("common", Context.MODE_PRIVATE).edit(); // TODO-rca: 決め打ちやめる?
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SharedPreferences.Editor getEditor(String name) {
|
public SharedPreferences.Editor getEditor(String name) {
|
||||||
return null;
|
// Editorの取得
|
||||||
|
return applicationContext.getSharedPreferences(name, Context.MODE_PRIVATE).edit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user