From 33e415415bafc712a633880812ed90d03246c456 Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Mon, 1 Jul 2019 14:48:31 -0700 Subject: Update kpref docs --- core/README.md | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'core/README.md') diff --git a/core/README.md b/core/README.md index b9a10f5..b1140bf 100644 --- a/core/README.md +++ b/core/README.md @@ -71,6 +71,14 @@ object MyPrefs : KPref() { Notice that it is a `val` and takes no default. It will return true the first time and false for all subsequent calls. +### KPref Testing + +If your android components can be tested without an emulator, you can also modify KPref to operate without shared preferences. +To do so, call `KPref(KPrefBuilderInMemory)` when creating your preferences. +This variant does not pass updates to the shared preferences. +To set the builder, you may wish to use dependency injection or service locators to supply the builder and the KPref. +In that case, your preferences would be a class instead of an object. + ## Changelog XML Create an xml resource with the following structure: -- cgit v1.2.3