@@ -15,7 +15,6 @@ A lite weight SharedPreference library which uses annotation processing to gener
1515* Bug fixes
1616* Support for ` Preference ` file
1717
18- The preference
1918
2019### Usage
2120
@@ -32,7 +31,11 @@ class InecBox @SharedPref("key") @Preference constructor(context: Context) {
3231 @ReadPrefString(" pref_ballot" )
3332 var fakeBallot: String? = null
3433
35- private var jsp : JadeSharedPreference = JadeSharedPreference .plug(this , context)
34+ // Setup for SharedPreference file
35+ private var jsp : JadeSharedPreference = JadeSharedPreference .apply (this , context)
36+
37+ // Setup for Preference file
38+ private var jp : JadeSharedPreference = JadeSharedPreference .preference(this , context)
3639
3740 // Read and write to JadeSharedPreference
3841 fun inecBox () {
@@ -47,29 +50,17 @@ class InecBox @SharedPref("key") @Preference constructor(context: Context) {
4750 // Read and write to Preference
4851 fun fakeInecBox () {
4952 // Insert item to JadeSharedPreference
50- jsp .insert(" pref_ballot" , " Fake Ballot Paper" )
53+ jp .insert(" pref_ballot" , " Fake Ballot Paper" )
5154 }
5255
5356 fun readFakeBallot (){
5457 Log .d(TAG , fakeBallot)
5558 }
56-
57- // Listen to changes in SharedPreference
58- @ReadString(" ballot" )
59- fun readStringChanges (s : String ){
60- Log .d(TAG , s)
61- }
62-
63-
64- // Listen to changes in SharedPreference
65- @ReadString(" fake_ballot" )
66- fun readFakeBallotChanges (fake : String ){
67- Log .d(TAG , fake)
68- }
6959
7060}
7161
7262```
63+ Check the sample project to see more sample usages.
7364
7465### Configuration
7566##### Step 1: Add it in your root build.gradle at the end of repositories:
0 commit comments