From 85282a2a34d513944b3fa9e2d873bb686f6a7bf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=8D=E3=82=80=E3=81=AD=E3=81=93?= Date: Mon, 11 Dec 2023 15:59:03 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=87=E3=82=A3=E3=83=AC=E3=82=AF=E3=83=88?= =?UTF-8?q?=E3=83=AA=E6=95=B4=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nem/lacerta/source/db/impl/placeholder | 0 .../nem/lacerta/source/db/model/placeholder | 0 .../nem/lacerta/source/db/module/placeholder | 0 .../lacerta/source/db/repository/placeholder | 0 .../lacerta/source/pref/impl/CommonImpl.java | 60 ------------------- .../nem/lacerta/source/pref/impl/placeholder | 0 .../nem/lacerta/source/pref/model/placeholder | 0 .../source/pref/module/CommonModule.java | 16 ----- .../lacerta/source/pref/module/placeholder | 0 .../source/pref/repository/Common.java | 18 ------ .../source/pref/repository/placeholder | 0 11 files changed, 94 deletions(-) delete mode 100644 data/src/main/java/one/nem/lacerta/source/db/impl/placeholder delete mode 100644 data/src/main/java/one/nem/lacerta/source/db/model/placeholder delete mode 100644 data/src/main/java/one/nem/lacerta/source/db/module/placeholder delete mode 100644 data/src/main/java/one/nem/lacerta/source/db/repository/placeholder delete mode 100644 data/src/main/java/one/nem/lacerta/source/pref/impl/CommonImpl.java delete mode 100644 data/src/main/java/one/nem/lacerta/source/pref/impl/placeholder delete mode 100644 data/src/main/java/one/nem/lacerta/source/pref/model/placeholder delete mode 100644 data/src/main/java/one/nem/lacerta/source/pref/module/CommonModule.java delete mode 100644 data/src/main/java/one/nem/lacerta/source/pref/module/placeholder delete mode 100644 data/src/main/java/one/nem/lacerta/source/pref/repository/Common.java delete mode 100644 data/src/main/java/one/nem/lacerta/source/pref/repository/placeholder diff --git a/data/src/main/java/one/nem/lacerta/source/db/impl/placeholder b/data/src/main/java/one/nem/lacerta/source/db/impl/placeholder deleted file mode 100644 index e69de29b..00000000 diff --git a/data/src/main/java/one/nem/lacerta/source/db/model/placeholder b/data/src/main/java/one/nem/lacerta/source/db/model/placeholder deleted file mode 100644 index e69de29b..00000000 diff --git a/data/src/main/java/one/nem/lacerta/source/db/module/placeholder b/data/src/main/java/one/nem/lacerta/source/db/module/placeholder deleted file mode 100644 index e69de29b..00000000 diff --git a/data/src/main/java/one/nem/lacerta/source/db/repository/placeholder b/data/src/main/java/one/nem/lacerta/source/db/repository/placeholder deleted file mode 100644 index e69de29b..00000000 diff --git a/data/src/main/java/one/nem/lacerta/source/pref/impl/CommonImpl.java b/data/src/main/java/one/nem/lacerta/source/pref/impl/CommonImpl.java deleted file mode 100644 index 49cd07d0..00000000 --- a/data/src/main/java/one/nem/lacerta/source/pref/impl/CommonImpl.java +++ /dev/null @@ -1,60 +0,0 @@ -package one.nem.lacerta.source.pref.impl; - -import android.content.Context; -import android.content.SharedPreferences; - -import androidx.appcompat.app.AppCompatActivity; - -import java.util.ArrayList; -import java.util.List; -import java.util.stream.Collectors; - -import javax.inject.Inject; - -import dagger.hilt.android.AndroidEntryPoint; -import dagger.hilt.android.qualifiers.ApplicationContext; - -import one.nem.lacerta.source.pref.repository.Common; - -public class CommonImpl implements Common { - - Context applicationContext; - - @Inject - public CommonImpl(@ApplicationContext Context applicationContext) { - this.applicationContext = applicationContext; - } - - public String getStringValue(String key) { - SharedPreferences pref = applicationContext.getSharedPreferences("common", Context.MODE_PRIVATE); - return pref.getString(key, ""); - } - - public void setStringValue(String key, String value) { - SharedPreferences pref = applicationContext.getSharedPreferences("common", Context.MODE_PRIVATE); - SharedPreferences.Editor editor = pref.edit(); - editor.putString(key, value); - editor.apply(); - } - - public boolean isExist(String key) { - SharedPreferences pref = applicationContext.getSharedPreferences("common", Context.MODE_PRIVATE); - return pref.contains(key); - } - - public void remove(String key) { - SharedPreferences pref = applicationContext.getSharedPreferences("common", Context.MODE_PRIVATE); - SharedPreferences.Editor editor = pref.edit(); - editor.remove(key); - editor.apply(); - } - - public ArrayList getExistKeys() { - SharedPreferences pref = applicationContext.getSharedPreferences("common", Context.MODE_PRIVATE); - // キーだけをArrayListに切り出す - return new ArrayList<>(pref.getAll().keySet()); - } - - - -} diff --git a/data/src/main/java/one/nem/lacerta/source/pref/impl/placeholder b/data/src/main/java/one/nem/lacerta/source/pref/impl/placeholder deleted file mode 100644 index e69de29b..00000000 diff --git a/data/src/main/java/one/nem/lacerta/source/pref/model/placeholder b/data/src/main/java/one/nem/lacerta/source/pref/model/placeholder deleted file mode 100644 index e69de29b..00000000 diff --git a/data/src/main/java/one/nem/lacerta/source/pref/module/CommonModule.java b/data/src/main/java/one/nem/lacerta/source/pref/module/CommonModule.java deleted file mode 100644 index 1e5a8579..00000000 --- a/data/src/main/java/one/nem/lacerta/source/pref/module/CommonModule.java +++ /dev/null @@ -1,16 +0,0 @@ -package one.nem.lacerta.source.pref.module; - -import dagger.Binds; -import dagger.Module; -import dagger.hilt.InstallIn; -import dagger.hilt.components.SingletonComponent; -import one.nem.lacerta.source.pref.impl.CommonImpl; -import one.nem.lacerta.source.pref.repository.Common; - -@Module -@InstallIn(SingletonComponent.class) -abstract public class CommonModule { - - @Binds - public abstract Common bindCommon(CommonImpl commonImpl); -} diff --git a/data/src/main/java/one/nem/lacerta/source/pref/module/placeholder b/data/src/main/java/one/nem/lacerta/source/pref/module/placeholder deleted file mode 100644 index e69de29b..00000000 diff --git a/data/src/main/java/one/nem/lacerta/source/pref/repository/Common.java b/data/src/main/java/one/nem/lacerta/source/pref/repository/Common.java deleted file mode 100644 index dec372d0..00000000 --- a/data/src/main/java/one/nem/lacerta/source/pref/repository/Common.java +++ /dev/null @@ -1,18 +0,0 @@ -package one.nem.lacerta.source.pref.repository; - -import java.util.ArrayList; -import java.util.List; - -public interface Common { - // さまざまな用途で使うPref - - String getStringValue(String key); - - void setStringValue(String key, String value); - - boolean isExist(String key); - - void remove(String key); - - ArrayList getExistKeys(); -} diff --git a/data/src/main/java/one/nem/lacerta/source/pref/repository/placeholder b/data/src/main/java/one/nem/lacerta/source/pref/repository/placeholder deleted file mode 100644 index e69de29b..00000000